Input value is invalid of the field

G

Guest

I have a problem on the "frmDelivery". After i input the value and press
enter. it suppose to check the tlbReceiving table. if the value is existed.
the related data will extract to frmDelivery and all frmDelivery data are
save in tlbDelivery table. I know and thanks somebody help me so much. I
would like to post the link of Inventory.mdb file for you. if you do have
time please help me have a check. Actually, i have checked so many times, but
i still have the problem. Thank you for your help.
http://wongalan48.sinaman.com/Inventory.mdb

If you can teach me, please leave a message in here or you can send a
Inventory.mdb file to my e-mail address. E-mail: (e-mail address removed) /
(e-mail address removed)

Thank you very much
 
G

Guest

Alan48 said:
I have a problem on the "frmDelivery". After i input the value and press
enter. it suppose to check the tlbReceiving table. if the value is existed.
the related data will extract to frmDelivery and all frmDelivery data are
save in tlbDelivery table. I know and thanks somebody help me so much. I
would like to post the link of Inventory.mdb file for you. if you do have
time please help me have a check. Actually, i have checked so many times, but
i still have the problem. Thank you for your help.
http://wongalan48.sinaman.com/Inventory.mdb

If you can teach me, please leave a message in here or you can send a
Inventory.mdb file to my e-mail address. E-mail: (e-mail address removed) /
(e-mail address removed)

Thank you very much

I found a couple of problems... the worst is that your form is corrupt.
Delete it, do a compact and Repair. For other remedies, search Google groups
for "Corruption".

[Lot_No] is a text field, so in the SQL it needs to be delimited by quotes.
See the code.

I modified your code:

'*** begin code ****
Option Compare Database
Option Explicit

Private Sub Lot_No_AfterUpdate()
'declare variables
Dim db As Database, rst As Recordset
'set database
Set db = CurrentDb
'set recordset
Set rst = db.OpenRecordset("SELECT * From tlbReceiving WHERE Lot_No = '"
& Me![Lot_No] & "';")
' check for records
If Not (rst.BOF And rst.EOF) Then
With rst
Me![Description].Value = !Description
MsgBox "hi"
End With
Else
MsgBox "Lot No not found"
End If

'clean up
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub
'*** end code ***

HTH
 

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