Data type mismatch

Bartk

Board Regular
Joined
Jun 14, 2013
Messages
51
I have a database that you input data in on a form and then I can open a report which will show several entries within the database. Within the report off to the side of the entry I have a button with an embedded Macro which when I select it I want it to bring up the original form with all the information on the form.

I have the following error after I select the button:
Runtime Error 3464
Data type mismatch in criteria expression.

When I drill down into the embedded macro this is what I have for the following:

Private Sub Command29_Click()
DoCmd.OpenReport "Report1", acViewReport, , "Citation = '" & Me.Citation & "'"
End Sub

Any thoughts would be appreciated. Thanks in advance
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi, what's the datatype (and expected value) of Me.Citation

Since that's a button on your report, it should be a field on your report somewhere, I guess - and it should be single field containing one value (as opposed to some kind of field in the report that could have many rows of values).

Though since you say the report is opened from the form, I don't quite see the need to open (?) the already open form (?).
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top