Combo box requery

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two pull down combo boxes. The first one when selected will query a
list for the second one to select from. I need to know how to clear "blank
out" the second box if the information changes in the first one. Right now
it requeries but I need it to clear the previously selected information prior
to requerying.

I have used a macro to get it to requery.
 
James,

Add a SetValue action in your macro (right after the requery), with
arguments:
Item: [Name_of_the_combo_box_control]
Expression: Null

HTH,
Nikos
 
I tried that but it gives me the error stating that it can not set it to null
because it is a required field. On the table it is a required field and does
need to be selected so I hesitate to remove that option.

Is there a way to get around that so it will temporarily set it to Null or
blank so that the operator will have to reselect a new value from the
requiried list?

Nikos Yannacopoulos said:
James,

Add a SetValue action in your macro (right after the requery), with
arguments:
Item: [Name_of_the_combo_box_control]
Expression: Null

HTH,
Nikos

James Kendall said:
I have two pull down combo boxes. The first one when selected will query a
list for the second one to select from. I need to know how to clear "blank
out" the second box if the information changes in the first one. Right now
it requeries but I need it to clear the previously selected information prior
to requerying.

I have used a macro to get it to requery.
 
James,

This complicates things, I can't think of a direct workaround right off. If
you don't get a good answer from someone else reasonably soon, you could
post again.

An idirect workaround would be to use an unbound form, with code behind it
to manipulate data, but there's probably an easier way that escapes me right
now.

A cheap trick would be to maake the combo drop down, inviting the user ti
make a choice. To do that, you would need a couple of lines of code like:

Function cbo_dropdown()
Forms!YourFormName!cboName.SetFocus
Forms!YourFormName!cboName.Dropdown
End Sub

The code must be pasted in a general module (change YourFormName and cboName
to the actual form and control names). Then, the function can be run from
your macro by means of a RunCode action with argument cbo_dropdown().

Nikos


James Kendall said:
I tried that but it gives me the error stating that it can not set it to null
because it is a required field. On the table it is a required field and does
need to be selected so I hesitate to remove that option.

Is there a way to get around that so it will temporarily set it to Null or
blank so that the operator will have to reselect a new value from the
requiried list?

Nikos Yannacopoulos said:
James,

Add a SetValue action in your macro (right after the requery), with
arguments:
Item: [Name_of_the_combo_box_control]
Expression: Null

HTH,
Nikos

I have two pull down combo boxes. The first one when selected will
query
a
list for the second one to select from. I need to know how to clear "blank
out" the second box if the information changes in the first one.
Right
now
it requeries but I need it to clear the previously selected
information
prior
to requerying.

I have used a macro to get it to requery.
 
Back
Top