View reports first...

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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.
 
Back
Top