Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting text in textbox based on info from another table
Message
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Inserting text in textbox based on info from another table
Divers
Thread ID:
01096900
Message ID:
01096900
Vues:
62
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
Fil
Voir

Click here to load this message in the networking platform