Hi all,
Here is my code:
I get the Run-time error '2185' when I run it.
You can't reference a property or method for a control unless the control has the focus .!!!!!!!
If I put this line after defending of the strsql everything work well but I don't want to have this line in my code.
There are some SQL statements which has 2 conditions I can't set the focus for both of them at the same time.
Here is my code:
Code:
Private Sub Command12_Click()
Dim strSql As String
strSql = "Delete from tbl_city where CityId=" & Val(Me!txtEmail.Text) & ";"
Set cn = CurrentProject.Connection
cn.Execute strSql
Debug.Print "MyTableView created"
Set cn = Nothing
End Sub
You can't reference a property or method for a control unless the control has the focus .!!!!!!!
If I put this line after defending of the strsql everything work well but I don't want to have this line in my code.
Code:
' Me!txtEmail.SetFocus
Comment