PC Review


Reply
Thread Tools Rate Thread

Conditional Macro

 
 
Kay
Guest
Posts: n/a
 
      10th Dec 2009
Hi,

I would appreciate help with a macro in Access 2003. I have a subform where
the user picks from a drop-down a certain value, but the bound field does not
show...example, 1000 is the bound field value, but Compensation shows in the
field. I need a msgbox to appear if one value is chosen and another msgbox
to show if another value is chosen. I created a macro with a condition[
PymtID] = "compensation" or "Marketing" or "Education". The action is a
msgbox that pops up to tell them to add payment details. I also need a
different msgbox to pop up if the choice is "Other". First, do I use the
value that shows in the field or the value that is stored in the field in my
condition. I have tried it both ways, but the macro fires regardless of the
choice I have in the field. I tried placing the macro on the after update
event and then the on exit event of the PymtID field. What am I doing wrong?
 
Reply With Quote
 
 
 
 
Steve Schapel
Guest
Posts: n/a
 
      10th Dec 2009
Kay,

I think the After Update event of the PymtID combobox would be the best.

You need to use the actual value, rather than the associated displayed
value. Therefore I believe the Condition for the first MsgBox action in the
macro should be like this:
[PymtID]=1000 Or [PymtID]=1001 Or [PymtID]=1002
(... or whatever your actual numerical values for Marketing and Education
are).

--
Steve Schapel, Microsoft Access MVP


"Kay" <(E-Mail Removed)> wrote in message
news:2AD5E583-6E46-4BAA-B6C5-(E-Mail Removed)...
> Hi,
>
> I would appreciate help with a macro in Access 2003. I have a subform
> where
> the user picks from a drop-down a certain value, but the bound field does
> not
> show...example, 1000 is the bound field value, but Compensation shows in
> the
> field. I need a msgbox to appear if one value is chosen and another
> msgbox
> to show if another value is chosen. I created a macro with a condition[
> PymtID] = "compensation" or "Marketing" or "Education". The action is a
> msgbox that pops up to tell them to add payment details. I also need a
> different msgbox to pop up if the choice is "Other". First, do I use the
> value that shows in the field or the value that is stored in the field in
> my
> condition. I have tried it both ways, but the macro fires regardless of
> the
> choice I have in the field. I tried placing the macro on the after
> update
> event and then the on exit event of the PymtID field. What am I doing
> wrong?


 
Reply With Quote
 
Kay
Guest
Posts: n/a
 
      10th Dec 2009
Steve,

Thanks! I did get it to work with in(1000,5000,6000). I did not realize
you needed to reference the field for each "Or" so that is good to know. The
second condition fires as well, at least once I changed that to it's numeric
code. Thanks so much.

"Kay" wrote:

> Hi,
>
> I would appreciate help with a macro in Access 2003. I have a subform where
> the user picks from a drop-down a certain value, but the bound field does not
> show...example, 1000 is the bound field value, but Compensation shows in the
> field. I need a msgbox to appear if one value is chosen and another msgbox
> to show if another value is chosen. I created a macro with a condition[
> PymtID] = "compensation" or "Marketing" or "Education". The action is a
> msgbox that pops up to tell them to add payment details. I also need a
> different msgbox to pop up if the choice is "Other". First, do I use the
> value that shows in the field or the value that is stored in the field in my
> condition. I have tried it both ways, but the macro fires regardless of the
> choice I have in the field. I tried placing the macro on the after update
> event and then the on exit event of the PymtID field. What am I doing wrong?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Conditional Macro AltaEgo Microsoft Excel Discussion 0 26th May 2009 11:57 PM
Conditional macro Bartman Microsoft Access 3 12th Aug 2005 09:29 AM
conditional macro =?Utf-8?B?YWxsYW5hODM=?= Microsoft Access Macros 2 5th May 2005 08:31 PM
Macro and Conditional Macro Limitations??? =?Utf-8?B?QWRhbQ==?= Microsoft Access Macros 1 5th May 2005 08:13 AM
Conditional Macro run Anne Microsoft Access Macros 15 18th Dec 2004 07:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:58 PM.