Validation of combo box

  • Thread starter Thread starter Jasper de Bruin
  • Start date Start date
J

Jasper de Bruin

I want to use the value of a combo box in a macro, after
clicking a button next to it. So you select a value in the
combo box, nothing happens, and then you click on the
button, and the macro is started.

Is it possible to validate the combo box so that you have
to select a value? The validate function of the box itself
only works if you click the box, if you just leave it
blank (leave it as it is: blank) and click the button it
doesnt validate.

Is it possible to validate the combo box just when
clicking the button? How?

Thanks a lot!
 
In the macro design window, display the conditions column
(menu view > conditions).
Insert two new lines at the top; in the first line put in
the condition something like
"IsNull([Forms]![FormName].[ControlName])=True"
(put in the right names for your form and control),and in
the action next to it a message box. In the second line,
put three dots in the condition (this means carry out
action if the previous condition is met) and in the action
StopMacro.

Nikos Y. (nyannaco at in dot gr)
 
Thanks man, it helped me a lot!
-----Original Message-----
In the macro design window, display the conditions column
(menu view > conditions).
Insert two new lines at the top; in the first line put in
the condition something like
"IsNull([Forms]![FormName].[ControlName])=True"
(put in the right names for your form and control),and in
the action next to it a message box. In the second line,
put three dots in the condition (this means carry out
action if the previous condition is met) and in the action
StopMacro.

Nikos Y. (nyannaco at in dot gr)
-----Original Message-----
I want to use the value of a combo box in a macro, after
clicking a button next to it. So you select a value in the
combo box, nothing happens, and then you click on the
button, and the macro is started.

Is it possible to validate the combo box so that you have
to select a value? The validate function of the box itself
only works if you click the box, if you just leave it
blank (leave it as it is: blank) and click the button it
doesnt validate.

Is it possible to validate the combo box just when
clicking the button? How?

Thanks a lot!
.
.
 
Back
Top