2

First of all I want to say that I have read other questions similar to this one but they don't solve the issue.

I have a form which contains a sub-form. The master form simply has a list box which displays all the entries in a table (only showing three fields from it though) and the sub-form is designed to show all the data associated with the record that is selected in the list box.

I have set the Link Master Fields and Link Child Fields to be ClientID (the table is for client information). When I first open the master form the sub-form displays the data for the first item in the list box but when I select a different item in the list box the sub-form does not update. I have tried using the Requery VBA method but without much success.

Does anyone have any hints at all?

Cromulent
  • 3,788
  • 4
  • 31
  • 41

1 Answers1

5

Set the link master field to the name of the listbox. Ensure that the listbox returns a Client ID.

For example

 Row Source : SELECT ClientID, ClientName FROM Table
 Bound Column : 1
 Column Count : 2

 Link Master Fields : MyListBox
 Link Child Fields  : ClientID

Now, when the user selects a client from the listbox, the subform will update to data for that client.

Fionnuala
  • 90,370
  • 7
  • 114
  • 152
  • Heh, this is the second time you have helped me with Access (I wish I could do this project in a different database which I was more familiar with). Thank you. For reference I didn't realise that you had to set the Link Master Fields to the list box itself which is what was confusing me. – Cromulent Feb 20 '13 at 11:06
  • Just to be picky, this part is not database at all, it is RAD tools. You can have any back-end database you like with the MS Access :D – Fionnuala Feb 20 '13 at 11:14
  • Sorry I should have been more specific :). I meant use the database tools of my choice. – Cromulent Feb 20 '13 at 12:07