monoDeveloper
Programmer
- Apr 16, 2013
- 16
Hello
I wrote this SQL & it was working properly, but when I added extra search parameter always return no result in search even table data is exist ....I want to know the reason please:
after adding this part to Code: I face no result returned in my query.
even when I run same full query as MS.Access saved query it works , feel confused.
I wrote this SQL & it was working properly, but when I added extra search parameter always return no result in search even table data is exist ....I want to know the reason please:
Code:
strSQL = " SELECT supp_Req_SN FROM SupplyRequest " & _
" WHERE( supp_Req_SN = " & [txtRequestNumber].Value & " and " & _
" supplierID=" & cboSupplier & " and " & _
" creator_U_ID=" & txtEmpNumber & " and " & _
" supp_Req_Date =" & [txtDate].Value & ")"
Debug.Print strSQL
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
Debug.Print rs.RecordCount
If (rs.RecordCount > 0) Then
MsgBox "Data process done successfully", vbInformation + vbOKOnly
inResult = DMax("supp_Req_SN", "SupplyRequest") + 1
Me.txtRequestNumber = inResult
Else
MsgBox "Data process failed", vbInformation
cboSupplier.SetFocus
cboSupplier.SelStart = 0
cboSupplier.SelLength = Len(cboSupplier.Text)
End If ' End IF after insert data & check it
after adding this part to Code: I face no result returned in my query.
Code:
" supp_Req_Date =" & [txtDate].Value & ")"
even when I run same full query as MS.Access saved query it works , feel confused.