Requery on a ComboBox gives ODBC error

  • Follow


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




0
Reply Utf 3/14/2007 8:16:45 PM

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" wrote:

> 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
> 
> 
> 
> 
0
Reply Utf 3/15/2007 2:58:05 PM


1 Replies
222 Views

(page loaded in 0.059 seconds)

Similiar Articles:
















7/29/2012 5:25:44 PM


Reply: