New record data is empty in Report View

message from Dave on 4 Jun 2004
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/
 
=?Utf-8?B?VGFzaGE=?= replied to Dave on 4 Jun 2004
The record is not actually written to the table until you save the record programatically, close the form, or move to a new record. Add this code before your print command for your button. This will save the record.

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
 
Allen Browne replied to Dave on 4 Jun 2004
You need to save the record before you can print it.

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
 
Doug Munich replied to Allen Browne on 5 Jun 2004
Holding down the Shift key and pressing Enter also saves the record you're
working on.

Doug

"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
news:#M3lAdkSEHA.1544@TK2MSFTNGP09.phx.gbl...
 

Archived message: New record data is empty in Report View (Microsoft Access)