Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MS Access, forms and stuff!

Options
  • 14-06-2009 6:30pm
    #1
    Registered Users Posts: 1,086 ✭✭✭


    I am reasonably new to Microsoft Access. I am using forms to enter new information into the database. What I want to know is how to create a "list" or something of all entries so I can click into those entries and edit their information separately.

    I am used to doing this using html php and mysql where i would have a 'display all' page and each entry would have a hyperlink where i could open an edit page for that entry.

    Am I going about it right with MS Access?


Comments

  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    I think I understanding what you are asking so here goes:

    tblEntries contains all of your entries - Primary Key is called Entry_ID & list field is called myListData.

    Form2 (I'll get to Form1 in a minute) is a form bound to your table (all fields).

    Form1 contains a combobox (cboList) and its Row Source is SQL using Entry_ID and myListData with the former sorted descending.
    Then add a command button and allow the wizard to launch. You want it to open Form2 and select specific data using cboList. On the next screen of the wizard, link the combo's bound field (Entry_ID) with the Entry_ID on Form2 and then continue on through the wizard.

    If you wish (in design view) right click on the button and copy the button's code into an AfterUpdate event behind cboList.

    As for your question "Am I going about it right with MS Access?" - only you can answer that as we don't know your data!


  • Registered Users Posts: 7,265 ✭✭✭RangeR


    The EASIEST way is to use the AutoForm Wizard. When Access created the form based on your table, go into design view and see how it did it.

    Access forms are VERY powerful but very easy to create and manipulate once you get used to them.


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    The autoform will not make the listbox/combobox by default for Form1 (unless that field uses the lookup wizard).


  • Registered Users Posts: 7,265 ✭✭✭RangeR


    kbannon wrote: »
    The autoform will not make the listbox/combobox by default for Form1 (unless that field uses the lookup wizard).

    Where do list/combo boxes come into the equation? The OP was to create a list that can be edited, on a form.

    From the form wizard, chose the "Tabular" or £Datasheet" option.

    You and me behind the bike sheds at 6pm. We can settle it there. I can take ye, or so my mother always told me.


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    RangeR wrote: »
    Where do list/combo boxes come into the equation? The OP was to create a list that can be edited, on a form.

    From the form wizard, chose the "Tabular" or £Datasheet" option.
    OK maybe I'm misreading it / interpreting it differently
    RangeR wrote: »
    You and me behind the bike sheds at 6pm. We can settle it there. I can take ye, or so my mother always told me.
    Do ya want your go? Do ya? Do ya? I'd burst ya


  • Advertisement
  • Registered Users Posts: 197 ✭✭cracker


    The way I read it is that he wants a list box displaying an identifier field(e.g. name) and when he clicks on an item in the list it displays more detailed information for that record on the form? So the list box acts as a way to navigate to particular records.

    If so then you really need to use vba to do it.

    1. create an unbound list box and set the rowsource property to a query which displays the field you will use to navigate.
    2. set the recordsource property of your form to a table or query which shows all the information of the record. Make sure one text box on the form also displays the field that is being displayed in the list box. Set the form default view to "Single Form"
    3. then in the click event of the list box do something like
    searchValue = YourListBox.Value
    If Not IsNull(searchValue) Then
        Me.YourFormField.SetFocus
        DoCmd.FindRecord searchValue
    End If
    

    Now when you click on the list box the form will display all the details for the selected item.


  • Registered Users Posts: 1,086 ✭✭✭Peter B


    Hey,

    Firstly thanks for all the feedback and I apologise I did not word my question(s) clearly enough.

    I am used to working with PHP and HTML where I would have the following table:

    Companies
    Company_id
    Company_name
    Company_ARD
    Company_incorporation_date
    Company_address

    I would have used the following pages:

    Display all companies- Displayed as a list with a hyperlink on each company name.

    Edit Company – Upon clicking the hyperlink on the company name you are brought to an edit company page. This would allow you to edit all values in the ‘Companies’ table.

    The problem is I have no idea how to do this sort of structure in MS Access. It is probably very easy but I just can’t get my head around it.

    Maybe I am to use sub forms.

    Any help?


    Thanks again.


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    see the attached file for a very rough version of what you are after.

    When you click on the company name hyperlink (just formatted as a link but is not a link!) then the event triggers a macro (Macro1) to run and open the second form where the id=the current records id.


  • Registered Users Posts: 1,086 ✭✭✭Peter B


    kbannon wrote: »
    see the attached file for a very rough version of what you are after.

    When you click on the company name hyperlink (just formatted as a link but is not a link!) then the event triggers a macro (Macro1) to run and open the second form where the id=the current records id.

    That looks brilliant. Thanks very much KBannon! I'll have a look at that tonight!!!


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    glad to hear it!
    Where shall I email the invoice? :D


  • Advertisement
Advertisement