Querying without closing report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I created a report using A2K. The user enters a part number at a text box
and clicks on the Run Report button and the report runs based on information
entered on the textbox.
The report runs fine. The problem is that some people like to take the least
steps and they don't close the report before going back to the form and
repeating the process for another part number. This creates an erroneous
report. The data the comes out is not correct. Is there anyway to "refresh"
the data in the report, so the user does not have to close it to query
another report?
Thanks in advance for your responses.
 
Samantha said:
I created a report using A2K. The user enters a part number at a text box
and clicks on the Run Report button and the report runs based on information
entered on the textbox.
The report runs fine. The problem is that some people like to take the least
steps and they don't close the report before going back to the form and
repeating the process for another part number. This creates an erroneous
report. The data the comes out is not correct. Is there anyway to "refresh"
the data in the report, so the user does not have to close it to query
another report?


Why not close the report in the run report button's click
event?

It appears that you can set the report's Filter property and
the report will relayout itself. Try this kind of thing:

If AllReports![report name].IsOpen Then
With Reports![report name]
.Filter = "[part number] = " & Me.txtPartNumber
.FilterOn = True
End With
Else
DoCmd.OpenReport "report name", acViewPreview, _
WhereCondition:= "[part number] = " & Me.txtPartNumber
End If
 
Marshall, thanks for the idea! I was over complicating myself.

Marshall Barton said:
Samantha said:
I created a report using A2K. The user enters a part number at a text box
and clicks on the Run Report button and the report runs based on information
entered on the textbox.
The report runs fine. The problem is that some people like to take the least
steps and they don't close the report before going back to the form and
repeating the process for another part number. This creates an erroneous
report. The data the comes out is not correct. Is there anyway to "refresh"
the data in the report, so the user does not have to close it to query
another report?


Why not close the report in the run report button's click
event?

It appears that you can set the report's Filter property and
the report will relayout itself. Try this kind of thing:

If AllReports![report name].IsOpen Then
With Reports![report name]
.Filter = "[part number] = " & Me.txtPartNumber
.FilterOn = True
End With
Else
DoCmd.OpenReport "report name", acViewPreview, _
WhereCondition:= "[part number] = " & Me.txtPartNumber
End If
 

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

Back
Top