In Access 2007. How can I make the a value from a list box link to the form that the list box is on. Sub-form are no problem, you create the form, then when you add the sub form it asks you what field to link with. But I need to use a list box, when the form opens, the records in the list box should be only those related to the form. Sounds simple, but I can't figure this out... Pls aim me in the right direction.
feedback
|
|
There is no LinkChild/LinkMaster for listboxes, so no automatic way to filter the contents of the listbox like there is with subforms. The fact that you want to filter the listbox is perhaps a clue that you should consider whether or not you should be using a subform instead. Anyway, if you insist on doing it, you have to filter the listbox manually, either by setting its Rowsource in an appropriate OnCurrent event (if the listbox is on a main form, in the main form; if it's on a subform, likely in the parent form's OnCurrent). Alternatively, you could hardwire the filter criteria with a form control reference (e.g., Forms!MyForm!MyControl) and in the OnCurrent, you'd requery the listbox. But I'd step back and first determine that a listbox is the right way to display the data. | |||
|
feedback
|