Hi!!
I am a new member here
.... i have a vb code :
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("Fees Maintenance", DB_OPEN_DYNASET)
If Me.Invoice_type = "company invoice" Then
criterion = "Company_code = " & Me.Text4 & " And fromdate= #" & Me.Text0 & "#"
Else
criterion = "Memnum = " & Me.Text4
End If
Now the problem is that even if a date exists in fee maintenance table which is same as Me.Text0 (and code also matches Text4 control)then also it does not matches the criteria. why is that happening?? Otherwise if i remove the date part ie " And fromdate= #" & Me.Text0 & "#" from this line :
criterion = "Company_code = " & Me.Text4 & " And fromdate= #" & Me.Text0 & "#"
then it matches. I think there is some other syntax for comparing dates ..what is it??
I am a new member here

Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("Fees Maintenance", DB_OPEN_DYNASET)
If Me.Invoice_type = "company invoice" Then
criterion = "Company_code = " & Me.Text4 & " And fromdate= #" & Me.Text0 & "#"
Else
criterion = "Memnum = " & Me.Text4
End If
Now the problem is that even if a date exists in fee maintenance table which is same as Me.Text0 (and code also matches Text4 control)then also it does not matches the criteria. why is that happening?? Otherwise if i remove the date part ie " And fromdate= #" & Me.Text0 & "#" from this line :
criterion = "Company_code = " & Me.Text4 & " And fromdate= #" & Me.Text0 & "#"
then it matches. I think there is some other syntax for comparing dates ..what is it??