URGENT: code needed for VBA sub to link 2 textboxes!

  • Thread starter Thread starter bril_mo
  • Start date Start date
B

bril_mo

Guest
Can anyone help me out here? These are the things you need to know:

- Box1 and Box2 are two textboxes on Form1.
- When in Box1 a number is typed, a string must appear in Box2.
- The number in Box1 should be a ClientID, the string in Box2 is the CompanyName.
- ClientID and CompanyName are both fields in table Clients.

So the function must read the ClientID in Box1 (OnChange i guess), search Clients for the ClientID, then read the CompanyName in the same record and finally place that string into Box2.

I know there are a lot of experts on this forum, so i expect this thing to be solved today!
wink.gif
 
You might want to do this in the after update event for Box 1. You'll need to use the value from Box 1 in a Dlookup statement, which will find the value for Box 2, and then put that into Box 2.

Guess I don't mind answering questions at all, but you have to put a little effort into it, too, so figure out the code yourself.
 

Users who are viewing this thread

Back
Top Bottom