View reports first...

G

Guest

I have a button with code attached, that once clicked will envoke the
following. I would prefer to view first prior to printing, as there are many
pages (10 reports). What would I add to this code to get it to work, or is it
possible?

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to preview
MsgBox "Select a record to view"
Else
strWhere = "[employeeid] = " & Me.[EmployeeID]
DoCmd.OpenReport "W-4", acViewNormal, , strWhere
 
R

Rick Brandt

Bonnie43 said:
I have a button with code attached, that once clicked will envoke the
following. I would prefer to view first prior to printing, as there
are many pages (10 reports). What would I add to this code to get it
to work, or is it possible?

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to preview
MsgBox "Select a record to view"
Else
strWhere = "[employeeid] = " & Me.[EmployeeID]
DoCmd.OpenReport "W-4", acViewNormal, , strWhere

Change acViewNormal to acViewPreview.
 
G

Guest

Thank you, I feel stupid. It is always the obvious answers that bite you,
lol. Thanks for being here to share your expertise, it is greatly appreciated.

Rick Brandt said:
Bonnie43 said:
I have a button with code attached, that once clicked will envoke the
following. I would prefer to view first prior to printing, as there
are many pages (10 reports). What would I add to this code to get it
to work, or is it possible?

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to preview
MsgBox "Select a record to view"
Else
strWhere = "[employeeid] = " & Me.[EmployeeID]
DoCmd.OpenReport "W-4", acViewNormal, , strWhere

Change acViewNormal to acViewPreview.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top