new data entries are showing up blank in report

D

DazzaInSyd

i have a report designed to print a summary of table information based on a
primary key field, that is it prints only the current record displayed on the
data entry form (report is run from a command button on data entry/query
form).... however when a new entry is created and the print button pressed, i
get no data in the report, all the labels are there but the actual data is
blank.

I know the data is in the table, i can see it, i can even query it, but the
report refuses to show this new entry. It will show all existing entries, not
the one just done.

i have tried refresh, repaint, requery functions all to no avail, i'm stuck
and need a bit of advice... can you please help me out...
 
A

Allen Browne

What code do you have in the command button on your form?

See:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html

That shows how to:
a) ensure the new entry is saved
b) pass the value to the report through the WhereCondition, rather than
through the query.
 
D

DazzaInSyd

here's the code from the button

Private Sub CmdPrintSummary_Click()
On Error GoTo Err_CmmdPrintSummary_Click

Dim stDocName As String

stDocName = "rptSummarySheet"
DoCmd.OpenReport stDocName, acViewPreview

Exit_CmmdPrintSummary_Click:
Exit Sub

Err_CmmdPrintSummary_Click:
MsgBox Err.Description
Resume Exit_CmmdPrintSummary_Click

End Sub

the report is run from a query showing all table fields with the criteria:

[Forms]![tblMasterData]![Agency #]

the agency # is the primary key
 
A

Allen Browne

Check out the difference between your code and that suggested in the
article.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

DazzaInSyd said:
here's the code from the button

Private Sub CmdPrintSummary_Click()
On Error GoTo Err_CmmdPrintSummary_Click

Dim stDocName As String

stDocName = "rptSummarySheet"
DoCmd.OpenReport stDocName, acViewPreview

Exit_CmmdPrintSummary_Click:
Exit Sub

Err_CmmdPrintSummary_Click:
MsgBox Err.Description
Resume Exit_CmmdPrintSummary_Click

End Sub

the report is run from a query showing all table fields with the criteria:

[Forms]![tblMasterData]![Agency #]

the agency # is the primary key


Allen Browne said:
What code do you have in the command button on your form?

See:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html

That shows how to:
a) ensure the new entry is saved
b) pass the value to the report through the WhereCondition, rather than
through the query.
 

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