why Recordset not working

W

Wahab

Hi everybody
I'v created rst but its not working please let me know where I m doing wrong:

Set rst = CurrentDb.OpenRecordset("SELECT * FROM [Overtime Data] WHERE
CardNo = " & CardNo & " and OTMonth = # " & Format(OTMonth, "mm/dd/yy") & "#")
If rst.EOF Then
NormalOT = rst!Nor: NormalAmt = rst!NorAmt
else
end if
rst.close
end if
my idea is to have all Overtime data in one table after paying the overtime,
but beofre paying may be I will call back for editing. OTMonth Im entering
end months dates, hence in a table CardNo and OtMonth is PrimeryKey.

Thanks
 
W

Wolfgang Kais

Hello Wahab.

Wahab said:
Hi everybody
I'v created rst but its not working please let me know where I'm
doing wrong:

Set rst = CurrentDb.OpenRecordset("SELECT * FROM [Overtime Data]" & _
" WHERE CardNo=" & CardNo & " and" & _
" OTMonth=# " & Format(OTMonth, "mm/dd/yy") & "#")
If rst.EOF Then
NormalOT = rst!Nor
NormalAmt = rst!NorAmt
End If
rst.close

my idea is to have all Overtime data in one table after paying
the overtime, but beofre paying may be I will call back for editing.
OTMonth Im entering end months dates, hence in a table CardNo and
OtMonth is PrimeryKey.

Thanks

Do you have regional settings other than english?
Especially a date separator?
Try Format(OTMonth, "mm\/dd\/yy") instead.
 
W

Wahab

Thanks Wolfganf
I fixed it , problem was not in the recordset but i wasnot updating the
recordset, now its working fine.
Regards
Wahab

Wolfgang Kais said:
Hello Wahab.

Wahab said:
Hi everybody
I'v created rst but its not working please let me know where I'm
doing wrong:

Set rst = CurrentDb.OpenRecordset("SELECT * FROM [Overtime Data]" & _
" WHERE CardNo=" & CardNo & " and" & _
" OTMonth=# " & Format(OTMonth, "mm/dd/yy") & "#")
If rst.EOF Then
NormalOT = rst!Nor
NormalAmt = rst!NorAmt
End If
rst.close

my idea is to have all Overtime data in one table after paying
the overtime, but beofre paying may be I will call back for editing.
OTMonth Im entering end months dates, hence in a table CardNo and
OtMonth is PrimeryKey.

Thanks

Do you have regional settings other than english?
Especially a date separator?
Try Format(OTMonth, "mm\/dd\/yy") instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top