M
Mark
I am working on an Access 97 SR2 database
I wrote some code on the On Current Event of a main form
and it is supposed to change the row source and default
value of a combo box on a subform.
It works fine changing the Row Source, however whenever it
runs, rather than successfully changing the default value
it has #NAME# appear in the combo box for new blank
records.
What am I doing wrong?? (Code is below)
Thanks if you have an answer!!
Mark
Ontario, Canada
If Me.ClaimTypeID = 2 Then
Forms![FormName]![SubformName].Form!
[Supplier].RowSource = "QueryName1"
Forms![FormName]![SubformName].Form!
[Supplier].Requery
Forms![FormName]![SubformName].Form!
[Supplier].DefaultValue = "StringValue1"
Else
Forms![FormName]![SubformName].Form!
[Supplier].RowSource = "QueryName2"
Forms![FormName]![SubformName].Form!
[Supplier].Requery
Forms![FormName]![SubformName].Form!
[Supplier].DefaultValue = "StringValue2"
End If
I wrote some code on the On Current Event of a main form
and it is supposed to change the row source and default
value of a combo box on a subform.
It works fine changing the Row Source, however whenever it
runs, rather than successfully changing the default value
it has #NAME# appear in the combo box for new blank
records.
What am I doing wrong?? (Code is below)
Thanks if you have an answer!!
Mark
Ontario, Canada
If Me.ClaimTypeID = 2 Then
Forms![FormName]![SubformName].Form!
[Supplier].RowSource = "QueryName1"
Forms![FormName]![SubformName].Form!
[Supplier].Requery
Forms![FormName]![SubformName].Form!
[Supplier].DefaultValue = "StringValue1"
Else
Forms![FormName]![SubformName].Form!
[Supplier].RowSource = "QueryName2"
Forms![FormName]![SubformName].Form!
[Supplier].Requery
Forms![FormName]![SubformName].Form!
[Supplier].DefaultValue = "StringValue2"
End If