In VB I want to find whether an Order # exists from the db. But my lack of vb coding with sql experience is preventing me from doing this.
Here's the code:
So I want to know whether txtWorkOrder does exist in the db and if it doesn't a msgbox is displayed.
Thanks for the help.
Here's the code:
Code:
strSQL = "Select Distinct OhNo, CmImgRec, CmName, CmAddress From OrdHead Join CusMast"
strSQL = strSQL & " On OhCus = CmCust Where OhOrd = '" & txtWorkOrder & "' "
Set Rs = New ADODB.Recordset
Rs.Open strSQL, AppSetting.objConn
If Rs.EOF And txtWorkOrder <> Rs("OhOrd" & "") Then
MsgBox "Order doesn't exist"
End If
So I want to know whether txtWorkOrder does exist in the db and if it doesn't a msgbox is displayed.
Thanks for the help.