Link to home
Start Free TrialLog in
Avatar of vbAngel
vbAngel

asked on

VBA: User form in Excel

Hi everyone,
What I have created, using VBA in Excel, is a custom user form for customer payments input.
The form has 3 fields for specifying the customer number, the customer name and the amount paid.
The customer name is linked to a database in the same Excel s/sheet containing all customer numbers and names.
On the form I have a button and when pressed, I have a macro that runs and picks up the customer name by looking at the database until it finds the customer number and picks up the name - the cell on the right.  The macro works, but I want to know if there is a way to do this without pressing this button.
Can I get the macro to run or use another method so that the customer name can be displayed automatically once the customer is entered.
I am hoping this is pretty simple, but please help.
I can not think of a way and it does get annoying to always go through an extra step in order to verify the customer name.
Help!
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

put it under the on leave method of the textbox? or another method of the textbox, lost focus?

why do you want to do that anyway, it can be a bit cumbersome if you key in a wrong name and leave the box the program tries to look it up...

:O)Bruintje
Avatar of vbAngel
vbAngel

ASKER

"leave method of the textbox" or "lost focus" - what are those and how could I use them?
Are they available in VBA?

I need for the keyer to varify the customer name as the payment can be easily keyed to a wrong customer.  I want to display it tough, so the keyer can just look up, make sure the name is right and keep on keying other payments.
Thanks,
vb
ASKER CERTIFIED SOLUTION
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vbAngel

ASKER

Thanks Bruintje,
this is exactly what I wanted.
Simple yet effective.
Thanks again,
vb
glad it helped