Hi
My combos seem to have an acquired memory syndrome.
On a query facility, the after update of combo1 fills the rowsource of
combo2 using a sql string, like so:
Public Sub Combo1_AfterUpdate()
Dim nameField as String
Dim sql as String
nameField = Me.Controls("Combo1")
sql = "SELECT " & nameField & " FROM ContactsTbl;"
Me.Controls("Combo2").RowSourceType = "Table/Query"
Me.Controls("Combo2").RowSource = sql
End Sub
The problem is that when this process is done repeatedly, the second
combo wont accept updates that are not a compatible data type as the
previous run.
ie, if on the first run, nameField held a Number data type and on the
second run nameField holds a text data type, then I get an access
error.
I can't find any way to flush all histerisis of the previous data that
was ploncked into Combo2, nor can I find a reason for this behaviour.
As this process is used repeatedly, it is a critical flaw in the app
(a simplified Query Designer).
Regards
Andrew Wrigley
#IF
Giving Users access to the Access Query Designer is like giving a cage
full of monkeys a box full of machine guns.
#THEN
Teaching Users to use the Access Query Designer is like showing the
said monkeys what happens when they pull the triggers of the said
machine guns.
#END