Report preview behind database view

  • Thread starter Thread starter Belinda7237
  • Start date Start date
B

Belinda7237

I havea command button and I have it pull up a report for the existing record
for preview, but it always goes behind the database window so the user wont
be able to see it - how do i get it to preview in front of the database - ie.
it pops up and is visual with the click. Here is the code I have on the
button:

Private Sub Command45_Click()

On Error GoTo ProcError

If Me.Dirty = True Then 'Save the record first
Me.Dirty = False
End If

Debug.Print "[StatsPackageNumber] = " & Me.[STATSpackageNumber]

If Me.NewRecord = True Then
MsgBox "You must enter a new record before attempting to print it.", _
vbInformation, "No Data To Print..."
Else
DoCmd.OpenReport _
ReportName:="LA Individual Package Peer Review Summary", _
View:=acViewPreview, _
WhereCondition:="[StatsPackageNumber] = " _
& Me.[STATSpackageNumber]
End If

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Command45_Click..."
Resume ExitProc
 
set the report to Pop Up that should place it in front of it.
(you do this in the properties of the report)

hth
 
thanks, you saved me alot of time and frustration, and i knew it was
something that easy!

Maurice said:
set the report to Pop Up that should place it in front of it.
(you do this in the properties of the report)

hth
--
Maurice Ausum


Belinda7237 said:
I havea command button and I have it pull up a report for the existing record
for preview, but it always goes behind the database window so the user wont
be able to see it - how do i get it to preview in front of the database - ie.
it pops up and is visual with the click. Here is the code I have on the
button:

Private Sub Command45_Click()

On Error GoTo ProcError

If Me.Dirty = True Then 'Save the record first
Me.Dirty = False
End If

Debug.Print "[StatsPackageNumber] = " & Me.[STATSpackageNumber]

If Me.NewRecord = True Then
MsgBox "You must enter a new record before attempting to print it.", _
vbInformation, "No Data To Print..."
Else
DoCmd.OpenReport _
ReportName:="LA Individual Package Peer Review Summary", _
View:=acViewPreview, _
WhereCondition:="[StatsPackageNumber] = " _
& Me.[STATSpackageNumber]
End If

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Command45_Click..."
Resume ExitProc
 
My pleasure, that's why the group is here for ;-)
--
Maurice Ausum


Belinda7237 said:
thanks, you saved me alot of time and frustration, and i knew it was
something that easy!

Maurice said:
set the report to Pop Up that should place it in front of it.
(you do this in the properties of the report)

hth
--
Maurice Ausum


Belinda7237 said:
I havea command button and I have it pull up a report for the existing record
for preview, but it always goes behind the database window so the user wont
be able to see it - how do i get it to preview in front of the database - ie.
it pops up and is visual with the click. Here is the code I have on the
button:

Private Sub Command45_Click()

On Error GoTo ProcError

If Me.Dirty = True Then 'Save the record first
Me.Dirty = False
End If

Debug.Print "[StatsPackageNumber] = " & Me.[STATSpackageNumber]

If Me.NewRecord = True Then
MsgBox "You must enter a new record before attempting to print it.", _
vbInformation, "No Data To Print..."
Else
DoCmd.OpenReport _
ReportName:="LA Individual Package Peer Review Summary", _
View:=acViewPreview, _
WhereCondition:="[StatsPackageNumber] = " _
& Me.[STATSpackageNumber]
End If

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Command45_Click..."
Resume ExitProc
 
Back
Top