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
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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
 
Upvote 0

Forum statistics

Threads
1,212,056
Messages
6,105,650
Members
447,974
Latest member
misspancake

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top