when i run the record set to update the InvoiceT i get the following error Compile error. User-defined type not defined. It then hgighlights the line db As Database.
Scott Axton
@Reply 3 years ago
Check your typing / spelling.
You will probably have to post screenshots or snips of code. There isn't enough information here to help you.
Lynda ChaseOP
@Reply 3 years ago
Hi, thanks for your reply, this is the code:
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("InvoiceT", dbOpenDynaset)
rs.AddNew
rs!WorkOrderID = WorkOrderID
rs!InvoiceDate = Date
rs!IsPaid = False
rs.update
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
Kevin Robertson
@Reply 3 years ago
You may have a missing reference.
In the VB Editor go to Tools - References Make sure the following is checked (see screenshot)
Microsoft Office 16.0 Access database engine Object Library
Kevin Robertson
@Reply 3 years ago
Lynda ChaseOP
@Reply 3 years ago
Thank you, that fixed my problem.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Work Order Lessons.
The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.