We help IT Professionals succeed at work.

Datamismatch when doing a VBA Event in Access

cres1121
cres1121 asked
on
105 Views
Last Modified: 2017-04-03
I want to pass a variable when I double click on a form to open another form.  

 Line item number is a auto number with long integer on one table.

On the second table it is number with long integer.

When I created the double click event when I am on line item number

Private Sub line_item_number_DblClick(Cancel As Integer)
DoCmd.OpenForm "TBLservicelinedetails", WhereCondition:=" [line item number] = '" & Me.[line item number] & "'"
End Sub

Run time error 3464
Data type Mismatch in criteria expression....
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Perfect.  How do I make it a popupform?    So when I double click it will just be a little popup?
CERTIFIED EXPERT
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
Append the dialogue parameter:

DoCmd.OpenForm "TBLservicelinedetails", acNormal, , "[line item number] = " & Me![line item number].Value & "", acFormEdit, acDialog

Open in new window

/gustav
CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Wonderful.. I knew the pop up was easy just could not remember and he got my event to work.

Author

Commented:
Thank you!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions