Run-Time 13 Error - Type Mismatch

K

Kimberly

Here's the code for which I keep getting the above error.
I'm trying to add records to a table using VB in Access.
Any help that you can provide is much appreciated.

Public Sub cmdequipment_Click()

Dim dbMyDB As Database

Set dbMyDB = OpenDatabase
("Palletizer/Palletizing_Cost_Tracking.mdb")

Dim rsMyRS As New Recordset

Set rsMyRS = dbMyDB.OpenRecordSet
("tbl_equipmentparts_list", dbOpenDynaset)

rsMyRS.AddNew
rsMyRS!Date = Me.txtdate.Value
rsMyRS!Item_Descrip = Me.txtitemdesc.Value
rsMyRS!Item_Qty = Me.txtitemqty.Value
rsMyRS!Item_Unit_Cost = Me.txtitemcost.Value
rsMyRS!Payment_Frm_Id = Me.cbopayment.Value
rsMyRS!Purchase_Order_Num = Me.txtpo.Value

rsMyRS.Update

End Sub
 
D

Dirk Goldgar

Kimberly said:
Here's the code for which I keep getting the above error.
I'm trying to add records to a table using VB in Access.
Any help that you can provide is much appreciated.

Answered in another newsgroup, microsoft.public.access.modulesdoavba, to
which you also posted this question independently. That's called
"multiposting", and it's generally frowned on because others don't know
what answers have already been given, and so they duplicate the effort.
Also it's harder for you to keep track of the various replies, and it's
harder for later readers of the question, who may be looking for the
same answer, to learn what they need.

In most cases a single, well-chosen newsgroup will do. If your question
really is relevant to more than one newsgroup, the approved technique is
to "crosspost" it instead, by listing multiple newsgroups in the To: or
Newsgroups: line of a single message. If you do that, the message and
any replies will appear in all the listed newsgroups automatically,
which is beneficial to all concerned.
 

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