Private Sub txt_Actual_Change()
Dim sSQL As String
sSQL = "UPDATE TableA SET Actual = " & Me.txt_Actual.Text & ", Target = " & Me.txt_Target.Text & "WHERE FormName = 'TestForm'"
DoCmd.RunSQL (sSQL)
End Sub
Every time I load the form, I get an error message saying I can't reference the object unless it's focus is set.
Why do I have to set the focus on the control box? I don't think you have to do this in nomrla visual basic ?
It highlights the sSQL= line. I presume it is the txt_Actual.Text that is causing the problem ?
Dim sSQL As String
sSQL = "UPDATE TableA SET Actual = " & Me.txt_Actual.Text & ", Target = " & Me.txt_Target.Text & "WHERE FormName = 'TestForm'"
DoCmd.RunSQL (sSQL)
End Sub
Every time I load the form, I get an error message saying I can't reference the object unless it's focus is set.
Why do I have to set the focus on the control box? I don't think you have to do this in nomrla visual basic ?
It highlights the sSQL= line. I presume it is the txt_Actual.Text that is causing the problem ?