Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup Problem in Form

Status
Not open for further replies.

DomP

IS-IT--Management
Oct 15, 2001
53
US
I have three tables (two that are linked via ODBC to a legacy system) and 1 other table. I am trying to have a user enter an ID number where the person and organization will appear based on a match. I've only been able to create a look-up where all entries appear and the user can choose from the table. There are too many entries in the table for a lookup like this to work. I know this probably isn't very complicated but would appreciate the direction to set this up.

Thanks,

Dom
 
One way... In the afterupdate event of the control used to search by build your SQL statement and set it to the Rowsource of the listbox. Example...

Private Sub MyControl_afterupdate()

Me.MyListbox.rowsource = "SELECT * FROM MyTable WHERE ID = " & Me.txtMySearchValue

End sub

I only used the listbox example to show that it can be done easily. Another way is to use a Recordset object and populate text box controls with the name of the person found to have that id.

Hope that helps.

Gary
gwinn7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top