i have this logical error in my program. i will like the program to work like this--> if user only keys in CUS (customer name), the program will search all the entries under customer name which matches with what user have key in... if user keys in CUS and PROJ(projectname), program will find all those entries which matches both CUS and PROJ..etc.. below is the only comparsion statement to determine what to output... i tried using OR instead of AND, result wasnt correct..
i have some doubts under strinsert INSERT . i will like to ask will the rest of the comparsion statement (example : PCEquoteDB.[ProjectName] = '" & PROJ & " )works like "LIKE" statement as i only key in once INSERT ??
Do Until rs.EOF
If IsNull(rs("Bidlog")) Then
BL = "na"
Else
BL = rs("Bidlog")
End If
If IsNull(rs("Customer")) Then
CUS = "na"
Else
CUS = rs("Customer")
End If
If IsNull(rs("MFGPN")) Then
MFG = "na"
Else
MFG = rs("MFGPN")
End If
If IsNull(rs("ProjectName")) Then
PROJ = "na"
Else
PROJ = rs("ProjectName")
End If
strinsert = "INSERT into PCEfinal (DbDate,Bidlog,FileDate,Customer,ProjectName,MFGPN,CUSPN,Cmdty,Description,Mfg,VndPN,Vnd,PriceUSD,SelPrice,CStatus,Remarks)" & _
"SELECT DbDate, Bidlog,FileDate, Customer, ProjectName, MFGPN, CUSPN,Cmdty, Description, Mfg, VndPN, Vnd, PriceUSD, SelPrice, CStatus, Remarks" & _
"FROM PCEquoteDB " & _
"WHERE Bidlog LIKE '" & BL & "' OR Customer = '" & CUS & "' ProjectName = '" & PROJ & "' OR MFGPN= '" & MFG & "';"
'Bidlog LIKE '" & BL & "' and Customer = '" & CUS & "' and ProjectName = '" & PROJ & "'and MFGPN = '" & MFG & "';"
DoCmd.RunSQL strinsert
rs.MoveNext
Loop
rs.Close
i have some doubts under strinsert INSERT . i will like to ask will the rest of the comparsion statement (example : PCEquoteDB.[ProjectName] = '" & PROJ & " )works like "LIKE" statement as i only key in once INSERT ??