|
-
Jul 12th, 2000, 03:00 PM
#1
Thread Starter
New Member
I have an access database containg customer name, number and address.
When I enter the name PRICE, I want the code to search the database, offer me all the PRICEs so I can see if I'm entering a new customer or an existing customer. If its an existing customer I want to be able to then select that customer from the list an use the existing address and customer name to populate my new entry.
Any help out there?
Thanks
Bern
-
Jul 12th, 2000, 03:22 PM
#2
Member
Are you using VB, if you are here's some help, otherwise I can't help you,
Use a textbox to enter the cutomers name, have a data bound listbox with a Data control bound to it and three textboxes to store the data with a Data control bound to them, then use the following code:
Data1.Recordsource = "SELECT CustomerName, Number, Address FROM CustomersTable WHERE CustomerName = '" & Text1.Text & "'"
Make sure your listbox listfield is set to CustomerName. Then in the Click event of the listbox use the following code:
Data2.Recordset.FindFirst "CustomerName = '" & DBList.Text & "'"
This will fill your text boxes with the information you selected.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|