By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,290 Members | 2,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,290 IT Pros & Developers. It's quick & easy.

On Click Code

P: n/a
I have a code that I use on a form that I am trying to modify to open a
report. It is not quite working. The code that I have modified looks like
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EmpRpt"

stLinkCriteria = "[chrUserID]=" & "'" & Me![chrUserID] & "'"
DoCmd.OpenReport stDocName, , , stLinkCriteria

intView = acViewPreview
DoCmd.OpenReport "EmpRpt", intView, , strWhere

I have a form (EmpRpt) where the user selects chrUserID as well as a
BeginDate and EndDate. I want this code for a command button "On Click."
However, this is opening a report named EmpRpt and I want it to open in Print
Preview. Right now you can see it is not linking the dates and when I run
the code the labels pull up on the report, but not the data in the fields.
Any suggestions, I really know little about code.

Message posted via

Aug 8 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.