Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO .Addnew in Access 2000 Problem

Status
Not open for further replies.

benaround2

Programmer
Jun 24, 2005
14
US
What am I doing wrong, it keeps coming up with a status 130172 error code.

Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "tblReceivings", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTable
rs.AddNew
rs.Fields("VendorProductID") = 1
rs.Fields("CategoryID") = 1
rs.Fields("LocationID") = 2
rs.Fields("ReceivingDate") = Date
rs.Fields("ReceivingQuantity") = 20
rs.Fields("TeleFormID") = 1
rs.Fields("BeginningFormSerialNumber") = 890000
rs.Fields("EndingFormSerialNumber") = 890020
rs.Fields("ReceivingEmployeeID") = 1
rs.Update

Thanks ahead of time for your help.

 
What line is there error being generated from? What is the error description?
 

Maybe

rs.Fields("ReceivingDate") = Date

should be

rs.Fields("ReceivingDate") = Format(Date, "yyyy-mm-dd")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top