Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting text in textbox based on info from another tab
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01096900
Message ID:
01096940
Vues:
13
You need to use aliases. It will be something like this:
UPDATE AliasA
SET AliasA.address = AliasB.address
FROM Table1 AS AliasA
INNER Join Table2 AS AliasB
on AliasA.phone = AliasB.phone
>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!
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform