Switchboard macro

G

Guest

I have created a macro to open a form. When I run the macro, it opens the
form correctly. When I call the macro from the switchboard, it locks up the
database and I have to stop the database using the task manager.

Any help will be greatly appreciated
 
S

Steve Schapel

Karen,

In there any action in the macro apart from the OpenForm action? Are
you running it from the Click event of a command button?
 
G

Gina Whipp

Just thinking aloud...

If the macro opens the form and then you try to run the macro from the form
it's suppose to be opening it might be 'confused'. What is it you want the
macro to do since the form it's suppose to be opening is already open?
 
G

Guest

The switchboard command is set to "Run Macro"
The macro is:
Line 1 - Action: Echo - No
Line 2 - Action: Hourglass - Yes
Line 3 - Condition: IsNull([Forms]![frmLogin]![Region]) And
IsNull([Forms]![frmLogin]![Division])
Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Data Mode: Edit
Line 4 - Condition: ...
Action: Stop Macro
Line 5 - Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Filter Name: qry2006DataEntry,
Where: qry2006DataEntry]![Region]=[Forms]![frmLogin]![Region] Or
[qry2006DataEntry]![division]=[Forms]![frmLogin]![division], Data Mode: Edit
Line 5 - Action: StopMacro

The frmLogin stays open at this point, just not visible. When the person
logs it, there are fields on the form that set values for what access they
have. When they open the form, if there are values filled in, the form
filters to those values. If they don't have any values, they have full
access and the entire form opens with all info.
As I mentioned, it works when I run the macro from the database window.
 
G

Gina Whipp

This is where I am confused... both forms are open, one is just not visible,
why are you trying to run the macro again while both forms are open? DO you
want to give someone the chance to change the information entered on
frmLogin? Or do you want to change the access granted to frmP&AEntry2006?
And is frmP&AEntry2006 the switchboard or does that have another name? And
when you say the switchboard command is set to "Run Macro", is that in an
Event Procedure on the forms open, in a command button on the swtichboard?

Remember no one here can SEE what's happening...


Karen said:
The switchboard command is set to "Run Macro"
The macro is:
Line 1 - Action: Echo - No
Line 2 - Action: Hourglass - Yes
Line 3 - Condition: IsNull([Forms]![frmLogin]![Region]) And
IsNull([Forms]![frmLogin]![Division])
Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Data Mode: Edit
Line 4 - Condition: ...
Action: Stop Macro
Line 5 - Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Filter Name: qry2006DataEntry,
Where: qry2006DataEntry]![Region]=[Forms]![frmLogin]![Region] Or
[qry2006DataEntry]![division]=[Forms]![frmLogin]![division], Data Mode:
Edit
Line 5 - Action: StopMacro

The frmLogin stays open at this point, just not visible. When the person
logs it, there are fields on the form that set values for what access they
have. When they open the form, if there are values filled in, the form
filters to those values. If they don't have any values, they have full
access and the entire form opens with all info.
As I mentioned, it works when I run the macro from the database window.

Steve Schapel said:
Karen,

In there any action in the macro apart from the OpenForm action? Are
you running it from the Click event of a command button?
 
G

Guest

I will try to explain again.

When the user logs into the database, they use a Login Form. She enters her
user name and password and clicks ok. The underlying macro for that form
checks to see if the user name and password are valid and in the usertable.
If it is valid, then then the region field on the Login Form value is set to
that users region and/or the division field is set to the users division.
The set value for the login form is then set visible to no. The region and
division fields are used to filter the frmP&A2006Entry records for that user.

Using the switchboard manager, I created a switchboard item to run the macro
that I detailed below. When the user clicks on the menu item, then the form
should open and show those records based on their region/division access
(coming from the frmLogin that is not visible).

As I mentioned, this macro works fine when I run it from the database
window. I just can't get it to work when I use the switchboard manager.

Gina Whipp said:
This is where I am confused... both forms are open, one is just not visible,
why are you trying to run the macro again while both forms are open? DO you
want to give someone the chance to change the information entered on
frmLogin? Or do you want to change the access granted to frmP&AEntry2006?
And is frmP&AEntry2006 the switchboard or does that have another name? And
when you say the switchboard command is set to "Run Macro", is that in an
Event Procedure on the forms open, in a command button on the swtichboard?

Remember no one here can SEE what's happening...


Karen said:
The switchboard command is set to "Run Macro"
The macro is:
Line 1 - Action: Echo - No
Line 2 - Action: Hourglass - Yes
Line 3 - Condition: IsNull([Forms]![frmLogin]![Region]) And
IsNull([Forms]![frmLogin]![Division])
Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Data Mode: Edit
Line 4 - Condition: ...
Action: Stop Macro
Line 5 - Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Filter Name: qry2006DataEntry,
Where: qry2006DataEntry]![Region]=[Forms]![frmLogin]![Region] Or
[qry2006DataEntry]![division]=[Forms]![frmLogin]![division], Data Mode:
Edit
Line 5 - Action: StopMacro

The frmLogin stays open at this point, just not visible. When the person
logs it, there are fields on the form that set values for what access they
have. When they open the form, if there are values filled in, the form
filters to those values. If they don't have any values, they have full
access and the entire form opens with all info.
As I mentioned, it works when I run the macro from the database window.

Steve Schapel said:
Karen,

In there any action in the macro apart from the OpenForm action? Are
you running it from the Click event of a command button?

--
Steve Schapel, Microsoft Access MVP

Karen wrote:
I have created a macro to open a form. When I run the macro, it opens
the
form correctly. When I call the macro from the switchboard, it locks
up the
database and I have to stop the database using the task manager.

Any help will be greatly appreciated
 
G

Gina Whipp

Karen,

Thank you for explaining but still unanswered is >>>>
And when you say the switchboard command is set to "Run Macro", is that in
an Event Procedure on the forms open, in a command button on the
swtichboard?

If it were me I would open 'frmP&A2006Entry' using a stLinkCriteria such as,
DoCmd.OpenForm "frmP&A2006Entry", , ,
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm] And
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm]

I would place that Event Procedure of whatever is being double-clicked to
open 'frmP&A2006Entry' . Please note that it's different depending on
whether the field is text or number.

I hope I explained that clearly....


Karen said:
I will try to explain again.

When the user logs into the database, they use a Login Form. She enters
her
user name and password and clicks ok. The underlying macro for that form
checks to see if the user name and password are valid and in the
usertable.
If it is valid, then then the region field on the Login Form value is set
to
that users region and/or the division field is set to the users division.
The set value for the login form is then set visible to no. The region
and
division fields are used to filter the frmP&A2006Entry records for that
user.

Using the switchboard manager, I created a switchboard item to run the
macro
that I detailed below. When the user clicks on the menu item, then the
form
should open and show those records based on their region/division access
(coming from the frmLogin that is not visible).

As I mentioned, this macro works fine when I run it from the database
window. I just can't get it to work when I use the switchboard manager.

Gina Whipp said:
This is where I am confused... both forms are open, one is just not
visible,
why are you trying to run the macro again while both forms are open? DO
you
want to give someone the chance to change the information entered on
frmLogin? Or do you want to change the access granted to
frmP&AEntry2006?
And is frmP&AEntry2006 the switchboard or does that have another name?
And
when you say the switchboard command is set to "Run Macro", is that in an
Event Procedure on the forms open, in a command button on the
swtichboard?

Remember no one here can SEE what's happening...


Karen said:
The switchboard command is set to "Run Macro"
The macro is:
Line 1 - Action: Echo - No
Line 2 - Action: Hourglass - Yes
Line 3 - Condition: IsNull([Forms]![frmLogin]![Region]) And
IsNull([Forms]![frmLogin]![Division])
Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Data Mode: Edit
Line 4 - Condition: ...
Action: Stop Macro
Line 5 - Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Filter Name: qry2006DataEntry,
Where: qry2006DataEntry]![Region]=[Forms]![frmLogin]![Region] Or
[qry2006DataEntry]![division]=[Forms]![frmLogin]![division], Data Mode:
Edit
Line 5 - Action: StopMacro

The frmLogin stays open at this point, just not visible. When the
person
logs it, there are fields on the form that set values for what access
they
have. When they open the form, if there are values filled in, the form
filters to those values. If they don't have any values, they have full
access and the entire form opens with all info.
As I mentioned, it works when I run the macro from the database window.

:

Karen,

In there any action in the macro apart from the OpenForm action? Are
you running it from the Click event of a command button?

--
Steve Schapel, Microsoft Access MVP

Karen wrote:
I have created a macro to open a form. When I run the macro, it
opens
the
form correctly. When I call the macro from the switchboard, it
locks
up the
database and I have to stop the database using the task manager.

Any help will be greatly appreciated
 
G

Guest

Opps, sorry about that. My switchboard manager shows: Command: Run Macro
and then I selected the macro mentioned below "mcrAccess.PvA". It is not
attached to any form. Is this not the proper way to run the macro? Would
this be why it locks up Access? I am confused because it runs fine when I
run the macro itself. Thanks for being patient. I am a bit frustrated.

Gina Whipp said:
Karen,

Thank you for explaining but still unanswered is >>>>
And when you say the switchboard command is set to "Run Macro", is that in
an Event Procedure on the forms open, in a command button on the
swtichboard?

If it were me I would open 'frmP&A2006Entry' using a stLinkCriteria such as,
DoCmd.OpenForm "frmP&A2006Entry", , ,
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm] And
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm]

I would place that Event Procedure of whatever is being double-clicked to
open 'frmP&A2006Entry' . Please note that it's different depending on
whether the field is text or number.

I hope I explained that clearly....


Karen said:
I will try to explain again.

When the user logs into the database, they use a Login Form. She enters
her
user name and password and clicks ok. The underlying macro for that form
checks to see if the user name and password are valid and in the
usertable.
If it is valid, then then the region field on the Login Form value is set
to
that users region and/or the division field is set to the users division.
The set value for the login form is then set visible to no. The region
and
division fields are used to filter the frmP&A2006Entry records for that
user.

Using the switchboard manager, I created a switchboard item to run the
macro
that I detailed below. When the user clicks on the menu item, then the
form
should open and show those records based on their region/division access
(coming from the frmLogin that is not visible).

As I mentioned, this macro works fine when I run it from the database
window. I just can't get it to work when I use the switchboard manager.

Gina Whipp said:
This is where I am confused... both forms are open, one is just not
visible,
why are you trying to run the macro again while both forms are open? DO
you
want to give someone the chance to change the information entered on
frmLogin? Or do you want to change the access granted to
frmP&AEntry2006?
And is frmP&AEntry2006 the switchboard or does that have another name?
And
when you say the switchboard command is set to "Run Macro", is that in an
Event Procedure on the forms open, in a command button on the
swtichboard?

Remember no one here can SEE what's happening...


The switchboard command is set to "Run Macro"
The macro is:
Line 1 - Action: Echo - No
Line 2 - Action: Hourglass - Yes
Line 3 - Condition: IsNull([Forms]![frmLogin]![Region]) And
IsNull([Forms]![frmLogin]![Division])
Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Data Mode: Edit
Line 4 - Condition: ...
Action: Stop Macro
Line 5 - Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Filter Name: qry2006DataEntry,
Where: qry2006DataEntry]![Region]=[Forms]![frmLogin]![Region] Or
[qry2006DataEntry]![division]=[Forms]![frmLogin]![division], Data Mode:
Edit
Line 5 - Action: StopMacro

The frmLogin stays open at this point, just not visible. When the
person
logs it, there are fields on the form that set values for what access
they
have. When they open the form, if there are values filled in, the form
filters to those values. If they don't have any values, they have full
access and the entire form opens with all info.
As I mentioned, it works when I run the macro from the database window.

:

Karen,

In there any action in the macro apart from the OpenForm action? Are
you running it from the Click event of a command button?

--
Steve Schapel, Microsoft Access MVP

Karen wrote:
I have created a macro to open a form. When I run the macro, it
opens
the
form correctly. When I call the macro from the switchboard, it
locks
up the
database and I have to stop the database using the task manager.

Any help will be greatly appreciated
 
G

Gina Whipp

When you say it 'shows' not sure what you mean but I'm going to say yes that
is why Access locks up. I have used DoCmd.RunMacro "mcrNameOfMacro" to run
macros before but from an Event Procedure on double-clicking of something,
not from a Command Button. It has been awhile though since I've even done
that so things might of changed.

But as I said before you could use DoCmd.OpenForm "frmP&A2006Entry", , ,
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm] And
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm]



Karen said:
Opps, sorry about that. My switchboard manager shows: Command: Run Macro
and then I selected the macro mentioned below "mcrAccess.PvA". It is not
attached to any form. Is this not the proper way to run the macro? Would
this be why it locks up Access? I am confused because it runs fine when I
run the macro itself. Thanks for being patient. I am a bit frustrated.

Gina Whipp said:
Karen,

Thank you for explaining but still unanswered is >>>>
And when you say the switchboard command is set to "Run Macro", is that
in
an Event Procedure on the forms open, in a command button on the
swtichboard?

If it were me I would open 'frmP&A2006Entry' using a stLinkCriteria such
as,
DoCmd.OpenForm "frmP&A2006Entry", , ,
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm] And
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm]

I would place that Event Procedure of whatever is being double-clicked to
open 'frmP&A2006Entry' . Please note that it's different depending on
whether the field is text or number.

I hope I explained that clearly....


Karen said:
I will try to explain again.

When the user logs into the database, they use a Login Form. She enters
her
user name and password and clicks ok. The underlying macro for that
form
checks to see if the user name and password are valid and in the
usertable.
If it is valid, then then the region field on the Login Form value is
set
to
that users region and/or the division field is set to the users
division.
The set value for the login form is then set visible to no. The region
and
division fields are used to filter the frmP&A2006Entry records for that
user.

Using the switchboard manager, I created a switchboard item to run the
macro
that I detailed below. When the user clicks on the menu item, then the
form
should open and show those records based on their region/division
access
(coming from the frmLogin that is not visible).

As I mentioned, this macro works fine when I run it from the database
window. I just can't get it to work when I use the switchboard
manager.

:

This is where I am confused... both forms are open, one is just not
visible,
why are you trying to run the macro again while both forms are open?
DO
you
want to give someone the chance to change the information entered on
frmLogin? Or do you want to change the access granted to
frmP&AEntry2006?
And is frmP&AEntry2006 the switchboard or does that have another name?
And
when you say the switchboard command is set to "Run Macro", is that in
an
Event Procedure on the forms open, in a command button on the
swtichboard?

Remember no one here can SEE what's happening...


The switchboard command is set to "Run Macro"
The macro is:
Line 1 - Action: Echo - No
Line 2 - Action: Hourglass - Yes
Line 3 - Condition: IsNull([Forms]![frmLogin]![Region]) And
IsNull([Forms]![frmLogin]![Division])
Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Data Mode: Edit
Line 4 - Condition: ...
Action: Stop Macro
Line 5 - Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Filter Name:
qry2006DataEntry,
Where: qry2006DataEntry]![Region]=[Forms]![frmLogin]![Region] Or
[qry2006DataEntry]![division]=[Forms]![frmLogin]![division], Data
Mode:
Edit
Line 5 - Action: StopMacro

The frmLogin stays open at this point, just not visible. When the
person
logs it, there are fields on the form that set values for what
access
they
have. When they open the form, if there are values filled in, the
form
filters to those values. If they don't have any values, they have
full
access and the entire form opens with all info.
As I mentioned, it works when I run the macro from the database
window.

:

Karen,

In there any action in the macro apart from the OpenForm action?
Are
you running it from the Click event of a command button?

--
Steve Schapel, Microsoft Access MVP

Karen wrote:
I have created a macro to open a form. When I run the macro, it
opens
the
form correctly. When I call the macro from the switchboard, it
locks
up the
database and I have to stop the database using the task manager.

Any help will be greatly appreciated
 
G

Gina Whipp

On another note, did you try posting this is the macro section? Someone
there might know better...


Karen said:
Opps, sorry about that. My switchboard manager shows: Command: Run Macro
and then I selected the macro mentioned below "mcrAccess.PvA". It is not
attached to any form. Is this not the proper way to run the macro? Would
this be why it locks up Access? I am confused because it runs fine when I
run the macro itself. Thanks for being patient. I am a bit frustrated.

Gina Whipp said:
Karen,

Thank you for explaining but still unanswered is >>>>
And when you say the switchboard command is set to "Run Macro", is that
in
an Event Procedure on the forms open, in a command button on the
swtichboard?

If it were me I would open 'frmP&A2006Entry' using a stLinkCriteria such
as,
DoCmd.OpenForm "frmP&A2006Entry", , ,
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm] And
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm]

I would place that Event Procedure of whatever is being double-clicked to
open 'frmP&A2006Entry' . Please note that it's different depending on
whether the field is text or number.

I hope I explained that clearly....


Karen said:
I will try to explain again.

When the user logs into the database, they use a Login Form. She enters
her
user name and password and clicks ok. The underlying macro for that
form
checks to see if the user name and password are valid and in the
usertable.
If it is valid, then then the region field on the Login Form value is
set
to
that users region and/or the division field is set to the users
division.
The set value for the login form is then set visible to no. The region
and
division fields are used to filter the frmP&A2006Entry records for that
user.

Using the switchboard manager, I created a switchboard item to run the
macro
that I detailed below. When the user clicks on the menu item, then the
form
should open and show those records based on their region/division
access
(coming from the frmLogin that is not visible).

As I mentioned, this macro works fine when I run it from the database
window. I just can't get it to work when I use the switchboard
manager.

:

This is where I am confused... both forms are open, one is just not
visible,
why are you trying to run the macro again while both forms are open?
DO
you
want to give someone the chance to change the information entered on
frmLogin? Or do you want to change the access granted to
frmP&AEntry2006?
And is frmP&AEntry2006 the switchboard or does that have another name?
And
when you say the switchboard command is set to "Run Macro", is that in
an
Event Procedure on the forms open, in a command button on the
swtichboard?

Remember no one here can SEE what's happening...


The switchboard command is set to "Run Macro"
The macro is:
Line 1 - Action: Echo - No
Line 2 - Action: Hourglass - Yes
Line 3 - Condition: IsNull([Forms]![frmLogin]![Region]) And
IsNull([Forms]![frmLogin]![Division])
Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Data Mode: Edit
Line 4 - Condition: ...
Action: Stop Macro
Line 5 - Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Filter Name:
qry2006DataEntry,
Where: qry2006DataEntry]![Region]=[Forms]![frmLogin]![Region] Or
[qry2006DataEntry]![division]=[Forms]![frmLogin]![division], Data
Mode:
Edit
Line 5 - Action: StopMacro

The frmLogin stays open at this point, just not visible. When the
person
logs it, there are fields on the form that set values for what
access
they
have. When they open the form, if there are values filled in, the
form
filters to those values. If they don't have any values, they have
full
access and the entire form opens with all info.
As I mentioned, it works when I run the macro from the database
window.

:

Karen,

In there any action in the macro apart from the OpenForm action?
Are
you running it from the Click event of a command button?

--
Steve Schapel, Microsoft Access MVP

Karen wrote:
I have created a macro to open a form. When I run the macro, it
opens
the
form correctly. When I call the macro from the switchboard, it
locks
up the
database and I have to stop the database using the task manager.

Any help will be greatly appreciated
 
G

Guest

Thanks anyway, I figured it out. It was the use of the Echo action in my
macro. I did not need it. I used trial and error to figure it out.

Gina Whipp said:
On another note, did you try posting this is the macro section? Someone
there might know better...


Karen said:
Opps, sorry about that. My switchboard manager shows: Command: Run Macro
and then I selected the macro mentioned below "mcrAccess.PvA". It is not
attached to any form. Is this not the proper way to run the macro? Would
this be why it locks up Access? I am confused because it runs fine when I
run the macro itself. Thanks for being patient. I am a bit frustrated.

Gina Whipp said:
Karen,

Thank you for explaining but still unanswered is >>>>
And when you say the switchboard command is set to "Run Macro", is that
in
an Event Procedure on the forms open, in a command button on the
swtichboard?

If it were me I would open 'frmP&A2006Entry' using a stLinkCriteria such
as,
DoCmd.OpenForm "frmP&A2006Entry", , ,
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm] And
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm]

I would place that Event Procedure of whatever is being double-clicked to
open 'frmP&A2006Entry' . Please note that it's different depending on
whether the field is text or number.

I hope I explained that clearly....


I will try to explain again.

When the user logs into the database, they use a Login Form. She enters
her
user name and password and clicks ok. The underlying macro for that
form
checks to see if the user name and password are valid and in the
usertable.
If it is valid, then then the region field on the Login Form value is
set
to
that users region and/or the division field is set to the users
division.
The set value for the login form is then set visible to no. The region
and
division fields are used to filter the frmP&A2006Entry records for that
user.

Using the switchboard manager, I created a switchboard item to run the
macro
that I detailed below. When the user clicks on the menu item, then the
form
should open and show those records based on their region/division
access
(coming from the frmLogin that is not visible).

As I mentioned, this macro works fine when I run it from the database
window. I just can't get it to work when I use the switchboard
manager.

:

This is where I am confused... both forms are open, one is just not
visible,
why are you trying to run the macro again while both forms are open?
DO
you
want to give someone the chance to change the information entered on
frmLogin? Or do you want to change the access granted to
frmP&AEntry2006?
And is frmP&AEntry2006 the switchboard or does that have another name?
And
when you say the switchboard command is set to "Run Macro", is that in
an
Event Procedure on the forms open, in a command button on the
swtichboard?

Remember no one here can SEE what's happening...


The switchboard command is set to "Run Macro"
The macro is:
Line 1 - Action: Echo - No
Line 2 - Action: Hourglass - Yes
Line 3 - Condition: IsNull([Forms]![frmLogin]![Region]) And
IsNull([Forms]![frmLogin]![Division])
Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Data Mode: Edit
Line 4 - Condition: ...
Action: Stop Macro
Line 5 - Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Filter Name:
qry2006DataEntry,
Where: qry2006DataEntry]![Region]=[Forms]![frmLogin]![Region] Or
[qry2006DataEntry]![division]=[Forms]![frmLogin]![division], Data
Mode:
Edit
Line 5 - Action: StopMacro

The frmLogin stays open at this point, just not visible. When the
person
logs it, there are fields on the form that set values for what
access
they
have. When they open the form, if there are values filled in, the
form
filters to those values. If they don't have any values, they have
full
access and the entire form opens with all info.
As I mentioned, it works when I run the macro from the database
window.

:

Karen,

In there any action in the macro apart from the OpenForm action?
Are
you running it from the Click event of a command button?

--
Steve Schapel, Microsoft Access MVP

Karen wrote:
I have created a macro to open a form. When I run the macro, it
opens
the
form correctly. When I call the macro from the switchboard, it
locks
up the
database and I have to stop the database using the task manager.

Any help will be greatly appreciated
 
G

Gina Whipp

Sorry I couldn't help more...

Karen said:
Thanks anyway, I figured it out. It was the use of the Echo action in my
macro. I did not need it. I used trial and error to figure it out.

Gina Whipp said:
On another note, did you try posting this is the macro section? Someone
there might know better...


Karen said:
Opps, sorry about that. My switchboard manager shows: Command: Run
Macro
and then I selected the macro mentioned below "mcrAccess.PvA". It is
not
attached to any form. Is this not the proper way to run the macro?
Would
this be why it locks up Access? I am confused because it runs fine
when I
run the macro itself. Thanks for being patient. I am a bit
frustrated.

:

Karen,

Thank you for explaining but still unanswered is >>>>
And when you say the switchboard command is set to "Run Macro", is
that
in
an Event Procedure on the forms open, in a command button on the
swtichboard?

If it were me I would open 'frmP&A2006Entry' using a stLinkCriteria
such
as,
DoCmd.OpenForm "frmP&A2006Entry", , ,
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm]
And
"[DataFieldFromUnderliningDataSourceOfForm]=" & Me![FieldFromForm]

I would place that Event Procedure of whatever is being double-clicked
to
open 'frmP&A2006Entry' . Please note that it's different depending on
whether the field is text or number.

I hope I explained that clearly....


I will try to explain again.

When the user logs into the database, they use a Login Form. She
enters
her
user name and password and clicks ok. The underlying macro for that
form
checks to see if the user name and password are valid and in the
usertable.
If it is valid, then then the region field on the Login Form value
is
set
to
that users region and/or the division field is set to the users
division.
The set value for the login form is then set visible to no. The
region
and
division fields are used to filter the frmP&A2006Entry records for
that
user.

Using the switchboard manager, I created a switchboard item to run
the
macro
that I detailed below. When the user clicks on the menu item, then
the
form
should open and show those records based on their region/division
access
(coming from the frmLogin that is not visible).

As I mentioned, this macro works fine when I run it from the
database
window. I just can't get it to work when I use the switchboard
manager.

:

This is where I am confused... both forms are open, one is just not
visible,
why are you trying to run the macro again while both forms are
open?
DO
you
want to give someone the chance to change the information entered
on
frmLogin? Or do you want to change the access granted to
frmP&AEntry2006?
And is frmP&AEntry2006 the switchboard or does that have another
name?
And
when you say the switchboard command is set to "Run Macro", is that
in
an
Event Procedure on the forms open, in a command button on the
swtichboard?

Remember no one here can SEE what's happening...


The switchboard command is set to "Run Macro"
The macro is:
Line 1 - Action: Echo - No
Line 2 - Action: Hourglass - Yes
Line 3 - Condition: IsNull([Forms]![frmLogin]![Region]) And
IsNull([Forms]![frmLogin]![Division])
Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Data Mode: Edit
Line 4 - Condition: ...
Action: Stop Macro
Line 5 - Action: OpenForm
Form Name: frmP&AEntry2006, View: Form, Filter Name:
qry2006DataEntry,
Where: qry2006DataEntry]![Region]=[Forms]![frmLogin]![Region] Or
[qry2006DataEntry]![division]=[Forms]![frmLogin]![division], Data
Mode:
Edit
Line 5 - Action: StopMacro

The frmLogin stays open at this point, just not visible. When
the
person
logs it, there are fields on the form that set values for what
access
they
have. When they open the form, if there are values filled in,
the
form
filters to those values. If they don't have any values, they
have
full
access and the entire form opens with all info.
As I mentioned, it works when I run the macro from the database
window.

:

Karen,

In there any action in the macro apart from the OpenForm action?
Are
you running it from the Click event of a command button?

--
Steve Schapel, Microsoft Access MVP

Karen wrote:
I have created a macro to open a form. When I run the macro,
it
opens
the
form correctly. When I call the macro from the switchboard,
it
locks
up the
database and I have to stop the database using the task
manager.

Any help will be greatly appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top