Form: Event Procedure & Macro from same button ?

unc2plo

Board Regular
Joined
Mar 18, 2002
Messages
148
I have a button on a form with a DLookup that checks the value in a text box against the value of a field in a static table. It gives you a message box that tells you whether the value is correct or not.

I would like to have the same button kick off a macro that would record the data from the text box into a table as well. I wrote the append query that will record the value into a table, but can't figure out how to make the button do both things with only 1 click.

Is that possible?

Thanks,
David
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
Assuming that the DLOOKUP is already in the Click event of the button, you could add this line to the code:
DoCmd.RunMacro "YourMacroNameHere"

Denis
 

Watch MrExcel Video

Forum statistics

Threads
1,118,327
Messages
5,571,560
Members
412,405
Latest member
DutchMonkey
Top