New record data is empty in Report View

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Okay, I have created a database in Access 2000. I have a small problem with
entering data and printing the report for it.

I enter data into the fields of a new record. When I click the form's Print
Record button, Report View appears with no data in the fields. But, when I
switch to another record and back to the current, and I reload Report View,
the fields are populated as desired.

Is this a glitch or a bug? How do I fix it? Any help is appreciated. Thanks!

============================
- Dave
http://members.cox.net/grundage/
 
You need to save the record before you can print it.

Something like this:

Private Sub cmdPrintRecord_Click()
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select a record to print."
Else
DoCmd.OpenReport "MyReport", acViewPreview, , "ID = " & Me.[ID]
End If
End Sub

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

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

Dave said:
Okay, I have created a database in Access 2000. I have a small problem with
entering data and printing the report for it.

I enter data into the fields of a new record. When I click the form's Print
Record button, Report View appears with no data in the fields. But, when I
switch to another record and back to the current, and I reload Report View,
the fields are populated as desired.

Is this a glitch or a bug? How do I fix it? Any help is appreciated.
Thanks!
 
Holding down the Shift key and pressing Enter also saves the record you're
working on.

Doug

Allen Browne said:
You need to save the record before you can print it.

Something like this:

Private Sub cmdPrintRecord_Click()
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select a record to print."
Else
DoCmd.OpenReport "MyReport", acViewPreview, , "ID = " & Me.[ID]
End If
End Sub

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

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

Dave said:
Okay, I have created a database in Access 2000. I have a small problem with
entering data and printing the report for it.

I enter data into the fields of a new record. When I click the form's Print
Record button, Report View appears with no data in the fields. But, when I
switch to another record and back to the current, and I reload Report View,
the fields are populated as desired.

Is this a glitch or a bug? How do I fix it? Any help is appreciated.
Thanks!
 
Back
Top