Requery on a ComboBox gives ODBC error

G

Guest

Hello -

I am trying to requery the values that show in ComboBox 2 based the value
that is selected in ComboBox 1.

Combo Box 2 values work when you first go to a new record and select a value
in ComboBox 1, but if you decide to go back and change the value in ComboBox
1, the old list of values are still in ComboBox 2

Some of the fields on this form do not allow NULLs and the ReQuery or
Refresh commands are giving me an ODBC error.

How do I refresh the values in ComboBox 2 ONLY without having to put data in
all the fields first?

I am using the following Event on the OnExit of ComboBox 1

DoCmd.Requery ([ComboBox2])


Thanks for your help.

sandy
 
G

Guest

When you change the value in combo1, combo2 will not requery automatically,
you have to make it do it yourself. Code an AFTER UPDATE event for combo1
with a requery:
Me!Combo2.Requery

-Dorian
 
G

Guest

Perfect - thanks so much!

mscertified said:
When you change the value in combo1, combo2 will not requery automatically,
you have to make it do it yourself. Code an AFTER UPDATE event for combo1
with a requery:
Me!Combo2.Requery

-Dorian

Sandy said:
Hello -

I am trying to requery the values that show in ComboBox 2 based the value
that is selected in ComboBox 1.

Combo Box 2 values work when you first go to a new record and select a value
in ComboBox 1, but if you decide to go back and change the value in ComboBox
1, the old list of values are still in ComboBox 2

Some of the fields on this form do not allow NULLs and the ReQuery or
Refresh commands are giving me an ODBC error.

How do I refresh the values in ComboBox 2 ONLY without having to put data in
all the fields first?

I am using the following Event on the OnExit of ComboBox 1

DoCmd.Requery ([ComboBox2])


Thanks for your help.

sandy
 

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