PC Review


Reply
Thread Tools Rate Thread

Access 2007 Macro Condition

 
 
Therese G. Maddox
Guest
Posts: n/a
 
      11th Mar 2010
Hi all!!

I'm writing a macro that isn't working.

Basically, I have a field [SpecificField] in a form that is determined by
some criteria choosen on the same form. The field comes up correctly with a
number.

Now I want to take that number in the field and tell access to to open a
form per the number. For example, if the field is = 1, then open Form 1, If
the field = 2, then open form 2, etc.

I'm using the conditions field of the macro and its not working at all. I'm
not getting any error messages or anything. Basically I have it set up like
this:

Condition Action Argument
1 OpenQuery Form Query,Datasheet,Edit
2 Close Form Query, Prompt
3 ReQuery SpecificField
4 [SpecificField]="Report 1" OpenForm Form 1,Form,,,,Normal
5 [SpecificField]="Report 2" OpenForm Form 2,Form,,,,Normal
6 [SpecificField]="Report 3" OpenForm Form 3,Form,,,,Normal



Line 4 opens a form named Form 1 if [SpecificField] on the open form =
Report 1
Line 5 opens a form named Form 2 if [SpecificField] on the open form =
Report 2
Line 6 opens a form named Form 3 if [SpecificField] on the open form =
Report 3

and so on.

Its not working. What am I doing wrong, or missing?

Thanks!!



 
Reply With Quote
 
 
 
 
Steve Schapel
Guest
Posts: n/a
 
      12th Mar 2010
Therese,

In your description of the process, you said the value of SpecificField was
a number... 1, 2, 3.

Therefore, I would have expected to see this in your macro condition:
[SpecificField]=1
.... instead of:
[SpecificField]="Report 1"

Getting sidetracked from your main question...
I am also unsure of the purpose or meaning of lines 1 and 2 in your macro,
OpenQuery and Close. This procedure does not appear to achieve anything, so
you can probably delete them from the macro.

The Requery in line 3 is also unusual... why do you need that?

--
Steve Schapel, Microsoft Access MVP


"Therese G. Maddox" <(E-Mail Removed)> wrote in
message news:F1325AD8-325C-4E75-944E-(E-Mail Removed)...
> Hi all!!
>
> I'm writing a macro that isn't working.
>
> Basically, I have a field [SpecificField] in a form that is determined by
> some criteria choosen on the same form. The field comes up correctly with
> a
> number.
>
> Now I want to take that number in the field and tell access to to open a
> form per the number. For example, if the field is = 1, then open Form 1,
> If
> the field = 2, then open form 2, etc.
>
> I'm using the conditions field of the macro and its not working at all.
> I'm
> not getting any error messages or anything. Basically I have it set up
> like
> this:
>
> Condition Action Argument
> 1 OpenQuery Form
> Query,Datasheet,Edit
> 2 Close Form Query, Prompt
> 3 ReQuery SpecificField
> 4 [SpecificField]="Report 1" OpenForm Form 1,Form,,,,Normal
> 5 [SpecificField]="Report 2" OpenForm Form 2,Form,,,,Normal
> 6 [SpecificField]="Report 3" OpenForm Form 3,Form,,,,Normal
>
>
>
> Line 4 opens a form named Form 1 if [SpecificField] on the open form =
> Report 1
> Line 5 opens a form named Form 2 if [SpecificField] on the open form =
> Report 2
> Line 6 opens a form named Form 3 if [SpecificField] on the open form =
> Report 3
>
> and so on.
>
> Its not working. What am I doing wrong, or missing?
>
> Thanks!!
>
>
>

 
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
MS Access - Macro - Condition Test - If A Table Exists rmhindley Microsoft Access 10 19th Aug 2008 12:57 AM
MS Access - Macro - Condition Test - If A Table Exists rmhindley Microsoft Access 0 16th Aug 2008 06:24 PM
Macro Condition 2007 =?Utf-8?B?Q0JLb3dpdHo=?= Microsoft Access Macros 1 22nd Aug 2007 04:22 PM
Re: Access 2003 - Macro condition Douglas J. Steele Microsoft Access Macros 0 19th Jan 2007 08:58 PM
How do I stop a condition in a macro in an Access database? =?Utf-8?B?Q2FsbGll?= Microsoft Access Macros 1 5th Dec 2005 08:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:52 PM.