I've been wanting to use the same form to query three similar tables. I have managed to achieve the Record Source part...
(see link http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=59283)
Now, I need to select records from the chosen source table.
Basically I need to dynamically change the table name referenced in the Row Source, in sync with the Record Source choice. Currently I have the following sql in my Row Source property:
SELECT DISTINCTROW NPD1.RferenceNO, NPD1.FullName FROM NPD1 WHERE (((NPD1.FullName) Not Like "Dummy*"));
and ... Me.RecordsetClone.FindFirst "[RferenceNO] = '" & Me![Combo2] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark, where Combo2 is my 'querying' combo box.
The other tables are NPD2 and NPD3, and contain the same fields but a different data set.
Any ideas how i can achieve this? (Cobmo box containing selection is called cboChoice.)
eg something like this?
SELECT DISTINCTROW [combobox selection from cboChoice].RferenceNO, combobox selection from cboChoice].FullName FROM combobox selection from cboChoice].WHERE [combobox selection from cboChoice].FullName) Not Like "Dummy*"));?
or maybe not?
Thanks for your time and ideas.
(see link http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=59283)
Now, I need to select records from the chosen source table.
Basically I need to dynamically change the table name referenced in the Row Source, in sync with the Record Source choice. Currently I have the following sql in my Row Source property:
SELECT DISTINCTROW NPD1.RferenceNO, NPD1.FullName FROM NPD1 WHERE (((NPD1.FullName) Not Like "Dummy*"));
and ... Me.RecordsetClone.FindFirst "[RferenceNO] = '" & Me![Combo2] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark, where Combo2 is my 'querying' combo box.
The other tables are NPD2 and NPD3, and contain the same fields but a different data set.
Any ideas how i can achieve this? (Cobmo box containing selection is called cboChoice.)
eg something like this?
SELECT DISTINCTROW [combobox selection from cboChoice].RferenceNO, combobox selection from cboChoice].FullName FROM combobox selection from cboChoice].WHERE [combobox selection from cboChoice].FullName) Not Like "Dummy*"));?
or maybe not?
Thanks for your time and ideas.