Solved Automatically bring customer data

FahadTiger

Member
Local time
Today, 12:39
Joined
Jun 20, 2021
Messages
115
Hi Expert..
I have a sales form..when I type the customer's name..it brings me the address and mobile number automatically
And when its not exit...I will enter the address and mobile phone in their respective text boxes and they are added to the customers table
Any Advice
 

Attachments

Your description is not clear. What is the desired event or sequence of events, and what do you want to happen. You have to remember that a lot of us old folks are VERY literal minded and you have to almost paint us a picture. Seeing your code doesn't help (yet) because obviously what you showed us doesn't do whatever you wanted; otherwise, you would never have asked the question.
 
In the Update event of the combo, look up the values of Address and Mobile and insert values in the unbound text boxes.

Better if you based the form's source on a query which combined the Sales and Customer details.

For getting the address and mobile for a new customer, I'd have a separate pop up form for the user to enter the new data.
 
Why not have a combo for customer names and bring in other details in the combo source, then just refer to the extra columns?
 
If I understood you correctly, something like this:
Thank you very much for the quick response
Yes, this is exactly what I want..I knew how to get customer data by querying..My problem was with adding the address or phone number..I used the RunSQL method.
But it works wrong
.
DoCmd.RunSQL "INSERT INTO CustomerT ([Address] )VALUES (" & txtAddress & ") WHERE customerID=" & Nz(Me.CustomerName, 0) & ";"
 
You need single quotes around your txtAddress and no need for the ";"
I would also use Me.txtAddress ?
I always put the sql string into a string variable so I can debug.print it to ensure it is correct, then use that in the command.
 

Users who are viewing this thread

Back
Top Bottom