C
claudeg007
Guest
Hi all,
I need your help on the following issue :
I have a table 'T1' with an AutoNumber field 'T1Id', a text field 'TF' and a Yes/No field 'YNF'.
I have another table 'T2' with an AutoNumber field 'T2Id' and a Yes/No field 'YNF2'.
I have a form with a combolist 'Model' an option button having its source data linked to T2.YNF2
When I change the state of the Option button 'OptBtn1', the field 'YNF2' of 'T2' is well updated, no problem on this one.
Now, I also need to update the field 'YNF' of table 'T1', with the record number depending of the combobox selection. I'm doing this through code at the AfterUpdate call :
Private Sub OptBtn1_AfterUpdate()
DoCmd.RunSQL ("UPDATE T1 SET T1.YNF = False WHERE T1.T1Id='" & Model.Value & "'")
End Sub
At execution, I got the error "Run-time error '3464': - Data type mismatch in criteria expression".
Could someone point me where I'm wrong ?
I need your help on the following issue :
I have a table 'T1' with an AutoNumber field 'T1Id', a text field 'TF' and a Yes/No field 'YNF'.
I have another table 'T2' with an AutoNumber field 'T2Id' and a Yes/No field 'YNF2'.
I have a form with a combolist 'Model' an option button having its source data linked to T2.YNF2
When I change the state of the Option button 'OptBtn1', the field 'YNF2' of 'T2' is well updated, no problem on this one.
Now, I also need to update the field 'YNF' of table 'T1', with the record number depending of the combobox selection. I'm doing this through code at the AfterUpdate call :
Private Sub OptBtn1_AfterUpdate()
DoCmd.RunSQL ("UPDATE T1 SET T1.YNF = False WHERE T1.T1Id='" & Model.Value & "'")
End Sub
At execution, I got the error "Run-time error '3464': - Data type mismatch in criteria expression".
Could someone point me where I'm wrong ?