Access 97 Recordset Problem

G

Guest

I am working from an Access 97 split database. I am attempting to print a
report. The datasource for the report is a recordset created from a filter.
The filter is created from data that is currently in the user form:

lngClaimNumber = Forms.frmMainForm.tbxClaim_Number

strCriteria = "SELECT * FROM tblCustomers"
strCriteria = strCriteria & " WHERE Claim_Number = "
strCriteria = strCriteria & lngClaimNumber

Set rsCurrentRecordSource = dbInput.OpenRecordset(strCriteria)

rsCurrentRecordSource.MoveLast
rsCurrentRecordSource.MoveFirst
Do Until rsCurrentRecordSource.EOF

'start printing here
Echo (0)
DoCmd.OpenReport "rptFolderReport", acDesign
Reports("rptFolderReport")!lblClaim_Number.Caption =
rsCurrentRecordSource!Claim_Number

DoCmd.Close acReport, "rptFolderReport", acSaveYes
DoCmd.OpenReport "rptFolderReport", acNormal

Echo (1)

rsCurrentRecordSource.MoveNext
Loop

rsCurrentRecordSource.Close
Set rsCurrentRecordSource = Nothing
dbInput.Close
Set dbInput = Nothing

This works when printing from a non-run-time front-end. However when
printing from run-time front-ends each successive print job prints using the
same filter criteria from the previous print job. In other words, the
recordset does not get refreshed when the Claim Number in the form
frmMainForm changes.
 
D

Douglas J Steele

You cannot open reports (or forms) in Design Mode using the run-time: that's
part of the point of it.
 
G

Guest

Thanks for your response. You are correct.

Douglas J Steele said:
You cannot open reports (or forms) in Design Mode using the run-time: that's
part of the point of it.
 

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