Run-Time Error

S

ServiceEnvoy

I'm getting a run-time error '13' with this line of code:

Private Sub VendorID_DblClick(Cancel As Integer)
DoCmd.OpenForm FRM_Expenses2, acFormDS, , , "vendorid=" & Me.VendorID
End Sub

I'm trying to open a form in Datasheet view called "Frm_Expenses2" and
display the records which have a matching vendorID field.

What do I need to do to resolve this error?
 
L

Linq Adams via AccessMonster.com

Best guess would be that VendorID is text (which it should be as you won't do
math with it) but your code it set up as if VendorID were numeric. I suspect
that

DoCmd.OpenForm FRM_Expenses2, acFormDS, , , "vendorid=" & Me.VendorID

should be

DoCmd.OpenForm FRM_Expenses2, acFormDS, , , "vendorid='" & Me.VendorID & "'"


I think I got those single/double quotes right! Can't check right now. Post
back if it still doesn't run!
 

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