Macro condition doesn't work

  • Thread starter Thread starter Betsy Simpkins
  • Start date Start date
B

Betsy Simpkins

I want to use a Macro to open a form, ONLY when a certain
choice is selected from a drop down menu on a different
form. I've followed the HELP example exactly, but it's not
working.

My condition is [Casetype]="VAWA"

Casetype is the combo box field on the form, and VAWA is
the selected choice. It seems that it is always returning
a False, so my form never opens.

Any ideas?
 
Betsy,

There is nothing wrong with the macro condition... assuming the macro
is triggered from an event on the same form that you have the CaseType
combobox. Otherwise you would need to include the full reference to
the form which the combobox is on. And it's not on a subform? And
CaseType is the actual name of the combobox? OK, the other thing to
check is the properties of the combobox. This is because what is
shown in a combobox is often different from the actual value of the
combobox's data,... this occurs when the bound column is different
from the first visible column. Is the Column Count property of the
combobox set to something other than 1? If so, what is entered for
the Bound Column and the Column Widths properties of the combobox?

- Steve Schapel, Microsoft Access MVP
 
Thanks Steve,

Yes, the combo box is on the same main form. It has an
event that runs the macro and opens another form. I set
the bound column to 0, because I'm ok with it storing the
actual data like "VAWA" instead of a number that
corresponds to that. I think that's right, right?
-----Original Message-----
Betsy,

There is nothing wrong with the macro condition... assuming the macro
is triggered from an event on the same form that you have the CaseType
combobox. Otherwise you would need to include the full reference to
the form which the combobox is on. And it's not on a subform? And
CaseType is the actual name of the combobox? OK, the other thing to
check is the properties of the combobox. This is because what is
shown in a combobox is often different from the actual value of the
combobox's data,... this occurs when the bound column is different
from the first visible column. Is the Column Count property of the
combobox set to something other than 1? If so, what is entered for
the Bound Column and the Column Widths properties of the combobox?

- Steve Schapel, Microsoft Access MVP


I want to use a Macro to open a form, ONLY when a certain
choice is selected from a drop down menu on a different
form. I've followed the HELP example exactly, but it's not
working.

My condition is [Casetype]="VAWA"

Casetype is the combo box field on the form, and VAWA is
the selected choice. It seems that it is always returning
a False, so my form never opens.

Any ideas?

.
 
Betsy,

Er, wrong. The first column is 1. Setting the bound column to 0 will
not work. If this doesn't fix it, post back with answers to my other
questions about Column Count, Column Widths.

You are probably getting confused with the Columns() property of the
combobox, for example where Me.NameOfCombobox.Column(0) will refer to
the value in the first column of the selected row. This is unrelated
to the Bound Column property in the design of the combobox.

- Steve Schapel, Microsoft Access MVP


Thanks Steve,

Yes, the combo box is on the same main form. It has an
event that runs the macro and opens another form. I set
the bound column to 0, because I'm ok with it storing the
actual data like "VAWA" instead of a number that
corresponds to that. I think that's right, right?
-----Original Message-----
Betsy,

There is nothing wrong with the macro condition... assuming the macro
is triggered from an event on the same form that you have the CaseType
combobox. Otherwise you would need to include the full reference to
the form which the combobox is on. And it's not on a subform? And
CaseType is the actual name of the combobox? OK, the other thing to
check is the properties of the combobox. This is because what is
shown in a combobox is often different from the actual value of the
combobox's data,... this occurs when the bound column is different
from the first visible column. Is the Column Count property of the
combobox set to something other than 1? If so, what is entered for
the Bound Column and the Column Widths properties of the combobox?

- Steve Schapel, Microsoft Access MVP


I want to use a Macro to open a form, ONLY when a certain
choice is selected from a drop down menu on a different
form. I've followed the HELP example exactly, but it's not
working.

My condition is [Casetype]="VAWA"

Casetype is the combo box field on the form, and VAWA is
the selected choice. It seems that it is always returning
a False, so my form never opens.

Any ideas?

.
 
Thanks Steve,

I set the Bound Column to 1, since there is only 1 column.
Therefore, Column Count is also 1. That fixed it. THANK
YOU :)
-----Original Message-----
Betsy,

Er, wrong. The first column is 1. Setting the bound column to 0 will
not work. If this doesn't fix it, post back with answers to my other
questions about Column Count, Column Widths.

You are probably getting confused with the Columns() property of the
combobox, for example where Me.NameOfCombobox.Column(0) will refer to
the value in the first column of the selected row. This is unrelated
to the Bound Column property in the design of the combobox.

- Steve Schapel, Microsoft Access MVP


Thanks Steve,

Yes, the combo box is on the same main form. It has an
event that runs the macro and opens another form. I set
the bound column to 0, because I'm ok with it storing the
actual data like "VAWA" instead of a number that
corresponds to that. I think that's right, right?
-----Original Message-----
Betsy,

There is nothing wrong with the macro condition... assuming the macro
is triggered from an event on the same form that you
have
the CaseType
combobox. Otherwise you would need to include the full reference to
the form which the combobox is on. And it's not on a subform? And
CaseType is the actual name of the combobox? OK, the other thing to
check is the properties of the combobox. This is
because
what is
shown in a combobox is often different from the actual value of the
combobox's data,... this occurs when the bound column
is
different
from the first visible column. Is the Column Count property of the
combobox set to something other than 1? If so, what is entered for
the Bound Column and the Column Widths properties of
the
combobox?
- Steve Schapel, Microsoft Access MVP


On Fri, 16 Jan 2004 12:43:41 -0800, "Betsy Simpkins"

I want to use a Macro to open a form, ONLY when a certain
choice is selected from a drop down menu on a different
form. I've followed the HELP example exactly, but it's not
working.

My condition is [Casetype]="VAWA"

Casetype is the combo box field on the form, and VAWA is
the selected choice. It seems that it is always returning
a False, so my form never opens.

Any ideas?

.

.
 
Back
Top