How can i solve this Error 2113

G

Guest

Private Sub Lot_No_AfterUpdate()
Dim db As Database, rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT * FROM tlbReceiving WHERE Lot_No = " &
Me![Lot_No])

With rst
Me![Rcv_Date] = !Rcv_Date
End With
End Sub

When i run the program, the SQLstr is work , but the code run to
"Me![Rcv_Date] = !Rcv_Date" , it prompt error '2113' , 'you input the value
is invalid in this field'.
But [tlbReceiving][Rcv_Date] has data in that table. Actually, i want the
sql check if passed. The related field data from tlbReceiving will pass a
data to this form field (Me![Rcv_Date]). and the form name call frmDelivery.
Do you know what is the problem. and hope you can help me to solve this
program. thank you all of you.
 
G

Guest

it could be that the date field coming from the recordset is a string. (Check
the table this is based on - is it a date field or a text field?)

if this is the case, try

Me![Rcv_Date] = CDate(!Rcv_Date)

...or a better option would be to change the underlying table to be a date
field.

Alternatively, if me!Rcv_Date has an input mask or a format, or a validation
rule, these might not match against the date/time you're trying to insert.
Check there also.
 

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