hello everyone
if any one can help me out i am trying to create an edit form which will take value from user which is "Txn_number" (auto number field) and search in the table and extract the record for editing when user clicks on button, i am using the following code. the problem is when user clicks the button another popup input box is appearing. i think there's some problem in SELECT statement as i am searching for a field which is not text. if any one can help me out.
Thanks in advance
Dim strsearch As String
Dim Task As String
'Check if a keyword entered or not
If IsNull(Me.txtsearch) Or Me.txtsearch = "" Then
MsgBox "Please type in your search keyword.", vbOKOnly, "Keyword Needed"
Me.txtsearch.BackColor = vbYellow
Me.txtsearch.SetFocus
Else
strsearch = Me.txtsearch.Value
Task = "SELECT * FROM tbl_fxmain WHERE (Txn_Number) = strsearch"
Me.RecordSource = Task
Me.txtsearch.BackColor = vbWhite
End If