Run time error 2185

Viewed 23130

I getting a run time error 2185, "You can't reference a property or method for a control unless the control has the focus ...".

This is my code that I am using.

Private Sub Command5_Click()
    Dim cardno As Integer
    cardno = cardnumber.Text
    DoCmd.OpenForm "search_card_number", acNormal, , WHERE & cardno = [Account Number]
End Sub
3 Answers
Related