Report preview behind database view

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
 
M

Maurice

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

hth
 
B

Belinda7237

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
 
M

Maurice

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
 

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