RE: Not Sure How To Do This



Thanks again for replying. The filter/query is showing up on the strWhere.
Now the problem is I'm using 1 form and a sub form and it doesn't show any of
the information is showing up on the report. What the report is supposed to
do is have it display the supervisor name on the main form and those that
work for him/her that are due a "Work Plan" in a given month. That month
being the combo149.

After I click on the print button, it keeps asking me for the name of the
supervisor and the month. This is getting crazy. I've been trying to get this
done for the past couple of weeks. If I had any hair left it would be gone.

Thanks for your help. I really appreciate it. Sorry to keep you on it so long.


Jack Leach wrote:
I don't see where you need a cmdFilter button... the sql string you build in
that procedure is not visible in the Print button's procedure, which is why
hovering over the mouse on strSQL in the Print sub is showing ""

Do you have an Option Explicit at the top of this module? That should be at
the top of every module, right there with the Option Compare Database
statement.

Anyway, I'd remove the filter button and leave the print button, and then
arrange your code in the cmdPrint_Click event like so:

'---------------------------------------------------------------------
Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

Dim stDocName As String 'Report Name
Dim strWhere As String 'Where clause for opening the report

stDocName = "rptTapsCover"

strWhere = "([tblTaps].[workplan] = """ & Me.Combo149 & """) AND " _
& "([tblTaps].[Supervisor] = """ & Me.cboloc & """)"

DoCmd.OpenReport stDocName, acPreview, , strWhere

Exit_cmdPrint_Click:
Exit Sub
Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click
End Sub
'---------------------------------------------------------------------

That should be all you need

Thanks for helping me out Jack. I've only been at Access for about 1 1/2 yrs.
There no one here that I can chat with so this board has been a tremendous
[quoted text clipped - 59 lines]
and hovered over the strSQL and all it said was: strSQL"" and that's it. What
that's telling me is that strSQL is not being passed. am I correct in this?

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200905/1

.


Loading