Find Record Help

  • Thread starter Thread starter cleanair
  • Start date Start date
C

cleanair

Guest
I have a table containing client info (name, address, company, ect). I would like to have a form (for data entry) that contains a list box that when I enter the company's name it produces all the address for that company in another box. Then if I select one of the addresses the form will change info to match the selected company address.

Thanks in advance
 
This is not easy if you are fairly new to follow but here goes:

You need to set up a query to list all the fields you need named say All Company Names on Database fields being Company Name, Address 1 etc etc.

Next set up a Combo Box from the toolbox that takes it's info from the query, it should show the following code in the Row Source of the Combo Box properties :


SELECT DISTINCTROW [All Company Names on Database].[Company Name], [All Company Names on Database].[Address 1], [All Company Names on Database].[Address 2], [All Company Names on Database].[Address 3], [All Company Names on Database].[Address 4], [All Company Names on Database].[Post Code] FROM [All Company Names on Database];

You then need to set up the following event in the After Update (choose Event Procedure and double click at the side of it to enter the procedure)

Private Sub Company_Name_AfterUpdate()
Me![Address 1] = Me![Company Name].Column(1)
Me![Address 2] = Me![Company Name].Column(2)
Me![Address 3] = Me![Company Name].Column(3)
Me![Address 4] = Me![Company Name].Column(4)
Me![Post Code] = Me![Company Name].Column(5)
End Sub

You then need to create five other text boxes names say Address 1 etc etc. for the other fields.

When you enter a few letters of the cusotmers name it should present you with a drop down combo box to choose the correct cusotmer name and populate the other boxes with the address

HTH


[This message has been edited by ptaylor-west (edited 10-08-2001).]
 

Users who are viewing this thread

Back
Top Bottom