Open a Form Based on selection in combo box after it is updated

J

Jenn

I need help opening my System Outage Alert Form when System Outage is
selected from my combo box called Subcategory. Any help would be
appreciated. I'm having a hard time figuring this out and I'm a very
inexperienced user.

Thank you!
 
G

Guest

What is the rowsource of your combobox? Is it a list of values or does it
pull from a table or query?

In either case, I think you want to create a hidden column in the combobox
that holds the name of the form you want to open. Then in the form's after
update event, put something like:
DoCmd.Open Form Me.SubCategory.Column(1)

The column number needs to be adjusted to whichever column contains the form
names (the column numbers start with 0).

Barry
 
J

Jenn

Okay I got a little further. I have a macro called SystemOutage which
does the following:
Action: OpenForm
Form Name: System Outage Alert
Where condition: This is what I can't figure out. I tried
Forms![Requests]![Subcategory] = "System Outage" however this doesn't
show just when System Outage is selected in the Subcategory combo, it
shows no matter what is selected in the combo.

Thanks again!
 
J

Jenn

The rowsource is a query. So if I only want the form to open when
system outage is selected, can I leave the others in the hidden column
blank so nothing happens?

Thanks!
 
G

Guest

You can debug this a little by putting a message box before this line in the
macro. Have the messagebox display the value of your combobox. This should
tell you a little more about what's going on.

Barry

Jenn said:
Okay I got a little further. I have a macro called SystemOutage which
does the following:
Action: OpenForm
Form Name: System Outage Alert
Where condition: This is what I can't figure out. I tried
Forms![Requests]![Subcategory] = "System Outage" however this doesn't
show just when System Outage is selected in the Subcategory combo, it
shows no matter what is selected in the combo.

Thanks again!
Jenn said:
I need help opening my System Outage Alert Form when System Outage is
selected from my combo box called Subcategory. Any help would be
appreciated. I'm having a hard time figuring this out and I'm a very
inexperienced user.

Thank you!
 
J

Jenn

I realize I'm a little dense on this, but I'm not following what you
mean?

Thanks!
Barry said:
You can debug this a little by putting a message box before this line in the
macro. Have the messagebox display the value of your combobox. This should
tell you a little more about what's going on.

Barry

Jenn said:
Okay I got a little further. I have a macro called SystemOutage which
does the following:
Action: OpenForm
Form Name: System Outage Alert
Where condition: This is what I can't figure out. I tried
Forms![Requests]![Subcategory] = "System Outage" however this doesn't
show just when System Outage is selected in the Subcategory combo, it
shows no matter what is selected in the combo.

Thanks again!
Jenn said:
I need help opening my System Outage Alert Form when System Outage is
selected from my combo box called Subcategory. Any help would be
appreciated. I'm having a hard time figuring this out and I'm a very
inexperienced user.

Thank you!
 
G

Guest

You already have a macro called SystemOutage. You can't figure out why the
form is opening regardless of which combobox item you choose. The next step
is to try to figure out what value the macro thinks is selected in
Forms![Requests]![Subcategory]. The simplest way to do this is to open your
macro in design view, insert a line above your OpenForm action and put in a
MsgBox action. In the Message property (down below), put in this:
=[Forms]![Requests]![Subcategory]
Make sure to include the equal sign.

This will display a msgbox that tells you what the macro sees as the value
of that combobox. It will help you debug why it's opening the form regardless
of what's selected.

Barry


Jenn said:
I realize I'm a little dense on this, but I'm not following what you
mean?

Thanks!
Barry said:
You can debug this a little by putting a message box before this line in the
macro. Have the messagebox display the value of your combobox. This should
tell you a little more about what's going on.

Barry

Jenn said:
Okay I got a little further. I have a macro called SystemOutage which
does the following:
Action: OpenForm
Form Name: System Outage Alert
Where condition: This is what I can't figure out. I tried
Forms![Requests]![Subcategory] = "System Outage" however this doesn't
show just when System Outage is selected in the Subcategory combo, it
shows no matter what is selected in the combo.

Thanks again!
Jenn wrote:
I need help opening my System Outage Alert Form when System Outage is
selected from my combo box called Subcategory. Any help would be
appreciated. I'm having a hard time figuring this out and I'm a very
inexperienced user.

Thank you!
 
J

Jenn

Okay, I did that and it appears it is seeing a number (which I believe
corresponds to the subcategory id from the subcategory table.) So does
that mean my Where condition should
be:[Forms]![Requests]![Subcategory]="1"

Thanks!

Barry said:
You already have a macro called SystemOutage. You can't figure out why the
form is opening regardless of which combobox item you choose. The next step
is to try to figure out what value the macro thinks is selected in
Forms![Requests]![Subcategory]. The simplest way to do this is to open your
macro in design view, insert a line above your OpenForm action and put in a
MsgBox action. In the Message property (down below), put in this:
=[Forms]![Requests]![Subcategory]
Make sure to include the equal sign.

This will display a msgbox that tells you what the macro sees as the value
of that combobox. It will help you debug why it's opening the form regardless
of what's selected.

Barry


Jenn said:
I realize I'm a little dense on this, but I'm not following what you
mean?

Thanks!
Barry said:
You can debug this a little by putting a message box before this line in the
macro. Have the messagebox display the value of your combobox. This should
tell you a little more about what's going on.

Barry

:

Okay I got a little further. I have a macro called SystemOutage which
does the following:
Action: OpenForm
Form Name: System Outage Alert
Where condition: This is what I can't figure out. I tried
Forms![Requests]![Subcategory] = "System Outage" however this doesn't
show just when System Outage is selected in the Subcategory combo, it
shows no matter what is selected in the combo.

Thanks again!
Jenn wrote:
I need help opening my System Outage Alert Form when System Outage is
selected from my combo box called Subcategory. Any help would be
appreciated. I'm having a hard time figuring this out and I'm a very
inexperienced user.

Thank you!
 
G

Guest

That should do it. Does it work?

Barry

Jenn said:
Okay, I did that and it appears it is seeing a number (which I believe
corresponds to the subcategory id from the subcategory table.) So does
that mean my Where condition should
be:[Forms]![Requests]![Subcategory]="1"

Thanks!

Barry said:
You already have a macro called SystemOutage. You can't figure out why the
form is opening regardless of which combobox item you choose. The next step
is to try to figure out what value the macro thinks is selected in
Forms![Requests]![Subcategory]. The simplest way to do this is to open your
macro in design view, insert a line above your OpenForm action and put in a
MsgBox action. In the Message property (down below), put in this:
=[Forms]![Requests]![Subcategory]
Make sure to include the equal sign.

This will display a msgbox that tells you what the macro sees as the value
of that combobox. It will help you debug why it's opening the form regardless
of what's selected.

Barry


Jenn said:
I realize I'm a little dense on this, but I'm not following what you
mean?

Thanks!
Barry Gilbert wrote:
You can debug this a little by putting a message box before this line in the
macro. Have the messagebox display the value of your combobox. This should
tell you a little more about what's going on.

Barry

:

Okay I got a little further. I have a macro called SystemOutage which
does the following:
Action: OpenForm
Form Name: System Outage Alert
Where condition: This is what I can't figure out. I tried
Forms![Requests]![Subcategory] = "System Outage" however this doesn't
show just when System Outage is selected in the Subcategory combo, it
shows no matter what is selected in the combo.

Thanks again!
Jenn wrote:
I need help opening my System Outage Alert Form when System Outage is
selected from my combo box called Subcategory. Any help would be
appreciated. I'm having a hard time figuring this out and I'm a very
inexperienced user.

Thank you!
 
J

Jenn

No, it doesn't. It still opens the form regardless of what is selected
in the combo box.

Thanks for helping out!
Barry said:
That should do it. Does it work?

Barry

Jenn said:
Okay, I did that and it appears it is seeing a number (which I believe
corresponds to the subcategory id from the subcategory table.) So does
that mean my Where condition should
be:[Forms]![Requests]![Subcategory]="1"

Thanks!

Barry said:
You already have a macro called SystemOutage. You can't figure out why the
form is opening regardless of which combobox item you choose. The next step
is to try to figure out what value the macro thinks is selected in
Forms![Requests]![Subcategory]. The simplest way to do this is to open your
macro in design view, insert a line above your OpenForm action and put in a
MsgBox action. In the Message property (down below), put in this:
=[Forms]![Requests]![Subcategory]
Make sure to include the equal sign.

This will display a msgbox that tells you what the macro sees as the value
of that combobox. It will help you debug why it's opening the form regardless
of what's selected.

Barry


:

I realize I'm a little dense on this, but I'm not following what you
mean?

Thanks!
Barry Gilbert wrote:
You can debug this a little by putting a message box before this line in the
macro. Have the messagebox display the value of your combobox. This should
tell you a little more about what's going on.

Barry

:

Okay I got a little further. I have a macro called SystemOutage which
does the following:
Action: OpenForm
Form Name: System Outage Alert
Where condition: This is what I can't figure out. I tried
Forms![Requests]![Subcategory] = "System Outage" however this doesn't
show just when System Outage is selected in the Subcategory combo, it
shows no matter what is selected in the combo.

Thanks again!
Jenn wrote:
I need help opening my System Outage Alert Form when System Outage is
selected from my combo box called Subcategory. Any help would be
appreciated. I'm having a hard time figuring this out and I'm a very
inexperienced user.

Thank you!
 
G

Guest

If you want, you could forward me a copy of your database. It would probably
be quicker if I looked at it directly. You can send it to
barry dot gilbert at hunterdouglas dot com

Barry

Jenn said:
No, it doesn't. It still opens the form regardless of what is selected
in the combo box.

Thanks for helping out!
Barry said:
That should do it. Does it work?

Barry

Jenn said:
Okay, I did that and it appears it is seeing a number (which I believe
corresponds to the subcategory id from the subcategory table.) So does
that mean my Where condition should
be:[Forms]![Requests]![Subcategory]="1"

Thanks!

Barry Gilbert wrote:
You already have a macro called SystemOutage. You can't figure out why the
form is opening regardless of which combobox item you choose. The next step
is to try to figure out what value the macro thinks is selected in
Forms![Requests]![Subcategory]. The simplest way to do this is to open your
macro in design view, insert a line above your OpenForm action and put in a
MsgBox action. In the Message property (down below), put in this:
=[Forms]![Requests]![Subcategory]
Make sure to include the equal sign.

This will display a msgbox that tells you what the macro sees as the value
of that combobox. It will help you debug why it's opening the form regardless
of what's selected.

Barry


:

I realize I'm a little dense on this, but I'm not following what you
mean?

Thanks!
Barry Gilbert wrote:
You can debug this a little by putting a message box before this line in the
macro. Have the messagebox display the value of your combobox. This should
tell you a little more about what's going on.

Barry

:

Okay I got a little further. I have a macro called SystemOutage which
does the following:
Action: OpenForm
Form Name: System Outage Alert
Where condition: This is what I can't figure out. I tried
Forms![Requests]![Subcategory] = "System Outage" however this doesn't
show just when System Outage is selected in the Subcategory combo, it
shows no matter what is selected in the combo.

Thanks again!
Jenn wrote:
I need help opening my System Outage Alert Form when System Outage is
selected from my combo box called Subcategory. Any help would be
appreciated. I'm having a hard time figuring this out and I'm a very
inexperienced user.

Thank you!
 
G

Guest

Jenn,

The problem was that your condition statement was in the Form Open action's
Where property. This property applies to the data in the form you want the
macro to open; it isn't a condition for running the action.

To get this to work correctly, move your statement
[Forms]![Requests]![Subcategory]=1 to the Condition column in front of the
OpenForm action at the top of the macro.

Also, I noticed that the statement includes a whole bunch of subcategory
codes. You should double-check this statement.

Barry

Jenn said:
No, it doesn't. It still opens the form regardless of what is selected
in the combo box.

Thanks for helping out!
Barry said:
That should do it. Does it work?

Barry

Jenn said:
Okay, I did that and it appears it is seeing a number (which I believe
corresponds to the subcategory id from the subcategory table.) So does
that mean my Where condition should
be:[Forms]![Requests]![Subcategory]="1"

Thanks!

Barry Gilbert wrote:
You already have a macro called SystemOutage. You can't figure out why the
form is opening regardless of which combobox item you choose. The next step
is to try to figure out what value the macro thinks is selected in
Forms![Requests]![Subcategory]. The simplest way to do this is to open your
macro in design view, insert a line above your OpenForm action and put in a
MsgBox action. In the Message property (down below), put in this:
=[Forms]![Requests]![Subcategory]
Make sure to include the equal sign.

This will display a msgbox that tells you what the macro sees as the value
of that combobox. It will help you debug why it's opening the form regardless
of what's selected.

Barry


:

I realize I'm a little dense on this, but I'm not following what you
mean?

Thanks!
Barry Gilbert wrote:
You can debug this a little by putting a message box before this line in the
macro. Have the messagebox display the value of your combobox. This should
tell you a little more about what's going on.

Barry

:

Okay I got a little further. I have a macro called SystemOutage which
does the following:
Action: OpenForm
Form Name: System Outage Alert
Where condition: This is what I can't figure out. I tried
Forms![Requests]![Subcategory] = "System Outage" however this doesn't
show just when System Outage is selected in the Subcategory combo, it
shows no matter what is selected in the combo.

Thanks again!
Jenn wrote:
I need help opening my System Outage Alert Form when System Outage is
selected from my combo box called Subcategory. Any help would be
appreciated. I'm having a hard time figuring this out and I'm a very
inexperienced user.

Thank you!
 

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