The way I got listboxes to work is a little obtuse compared to access.
The control needs to be assigned to a data object in the form, but when the wizard starts, what it is really asking you for, is where you want to look for your list items. Start by selecting a table you want the data to come from, then get the fields from that table you are comparing against the form control table. These don’t have to have the same name, but the contents must be compatible.
So, if you have a form expecting the index field from a table, but that doesn’t make any sens to the user, you wish them to select a value from other fields in another table, the source for the list comes first, and the assigned column from that list is set to be the same value as you wish to insert into the underlying form table. The field offset value is which field from the table to equate.
For exampe say you have a table called projects consisting of id,projectname, sponsorID and another table called sponsor with columns id,surname.
You wish to build a form based on projects, but need to use the sponsorID from a valid sponsor.
Once you have the basic form set up and saved,
-
add a listbox control.
The wizard starts but the first text mentions the data control.Ignore that, and read the 2nd sentence.
-
Pick the list source table or query that you want the users to make some sense of.
In the example above, select Sponsor and click Next.
-
Click on the column you would like to see displayed from the sponsor table. Click on Surname and click Next.
-
The wizard then presents you with 2 columns. On the left, select the field from the form data eg SponsorID, and from the right column, select the linked field, eg ID.
-
Click Finish. Save and view your form.
Job’s a good un.