Run Macro IF (1 Viewer)

QBC

New member
Local time
Today, 06:13
Joined
Aug 23, 2009
Messages
9
Hi,
I am using MS access 2010.
I have a form which has buttons on it running macros.
I need the software to check a field on that same form for its value when the user clicks on the macro button.
I need to macro button to be unavailalbe or not to run if the field does not equal the certain value.
Can anyone help me?
Thanks so much
 

rzw0wr

I will always be a newbie
Local time
Today, 09:13
Joined
Apr 1, 2012
Messages
489
Put the button action inside the if statement.
If the test is not met the the action will not run.

Dale
 

QBC

New member
Local time
Today, 06:13
Joined
Aug 23, 2009
Messages
9
I would do that but where do I put that in the Macros section of Access?
I am not using written code. I am using the Macro items that are in Access already.

In other words, if you hit design on macros in Access, it will give a sequence of items you can enter. How can I enter an IF statement there?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:13
Joined
Aug 30, 2003
Messages
36,140
I don't use macros, but you can have a condition. I don't have 2010 in front of me, but you want an If/Then block. In previous versions you'd want a condition. With the macro in design view, if you don't see a column called Condition, click on Conditions in the ribbon.
 

QBC

New member
Local time
Today, 06:13
Joined
Aug 23, 2009
Messages
9
Thanks so much Paul. It worked great.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:13
Joined
Aug 30, 2003
Messages
36,140
Happy to help.
 

Users who are viewing this thread

Top Bottom