Avatar of cres1121
cres1121
 asked on

Datamismatch when doing a VBA Event in Access

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....
VBAMicrosoft Access

Avatar of undefined
Last Comment
cres1121

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
cres1121

ASKER
Perfect.  How do I make it a popupform?    So when I double click it will just be a little popup?
Gustav Brock

Append the dialogue parameter:

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

Open in new window

/gustav
SOLUTION
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
cres1121

ASKER
Wonderful.. I knew the pop up was easy just could not remember and he got my event to work.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
cres1121

ASKER
Thank you!