Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Inserting text in textbox based on info from another table
Hey everyone,
I have a question I was hoping someone could help me with.
I have two tables with information in each. Both have several fields that are the exact same.
What I would like to do is when a user is in a form and is inputting data (going to table2) when they pass a specific numeric field it will check to see if the same number exists in table1 and automatically enter the information from a different field in table1 into the same named field of table2. Essentially, when going to the next field it will check the phone number in the text box against another table and automatically put in the address in the next text box if the phone numbers match.
This is what I've come up with but I need help:
Private Sub txtBox_LostFocus()
Update Table1 Left Join Table2 on Table1.phone = Table2.phone.text Set Table2.address.text = Table1.address
End Sub
Thanks so much for your help!
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement