Enter Parm value?

pullmyefinger

Registered User.
Local time
Today, 01:33
Joined
Feb 26, 2011
Messages
37
I looked thru the help and found a way to specify how to enter a value for certain records to print in a report.. The suggestion was to use:


DoCmd.OpenReport "somereport", , , "[somefieldname] = & Me.tbox

(tbox is a textbox)


I put in a text box, entered a value and ran the report, but it keeps saying to enter the parameter value and shows the value in the box that i already entered??

What the heck is going on? How do i get rid of the parameter box when i already entered the value?????????
 
If somefieldname is text then you need quotes and if dates you need octothorpes (#):

If text:
DoCmd.OpenReport "somereport", , , "[somefieldname] =" & Chr(34) & Me.tbox & Chr(34)

If date:
DoCmd.OpenReport "somereport", , , "[somefieldname] =#" & Me.tbox & "#"


and I noticed you forgot a quote after the = sign in your original post.
 

Users who are viewing this thread

Back
Top Bottom