Could anyone please help on the above error. I am trying to update a table using VBA aand am using the following code
When I run the code I get the compile error which points to Me.Type3
Strangely however if I use this code
The code compiles and runs ok.
I needed to add the SClass variables to the update statement shown above and this is when the compile error surfaced.
I can recognise that the problem is around the SType3 area but I cant see the wood for the trees. Can anyone suggest what is wrong?
Code:
strSQL = " UPDATE [patient]" & _
" SET [Current_Med] = '" & Me.MyMed & "'," & _
" [SType1] = '" & Me.SType_1 & "'," & _
" [SType2] = '" & Me.SType2 & "'," & _
" [SType3] = '" & Me.Stype3 & "'," & _
" [SClass1] = '" & Me.SClass1 & "'," & _
" [SClass2] = '" & Me.SClass2 & "'," & _
" [SClass3] = '" & Me.SClass3 & "'" & _
" WHERE ([UID] = '" & Me.Web_UID & "')"
Call DoCmd.RunSQL(strSQL)
Strangely however if I use this code
Code:
strSQL = " UPDATE [patient]" & _
" SET [Medication] = '" & Me.MyMed & "'," & _
" [SType_1] = '" & Me.SType_1 & "'," & _
" [SType2] = '" & Me.SType2 & "'," & _
" [SType3] = '" & Me.Stype3 & "'" & _
" WHERE ([Web_UID] = '" & Me.Web_UID & "')"
Call DoCmd.RunSQL(strSQL)
The code compiles and runs ok.
I needed to add the SClass variables to the update statement shown above and this is when the compile error surfaced.
I can recognise that the problem is around the SType3 area but I cant see the wood for the trees. Can anyone suggest what is wrong?
Last edited: