If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
New record data is empty in Report View
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/ |
#2
|
|||
|
|||
New record data is empty in Report View
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. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Dave" wrote in message news:Kk0wc.4511$wS2.4462@okepread03... 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 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! |
#3
|
|||
|
|||
New record data is empty in Report View
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 |
#4
|
|||
|
|||
New record data is empty in Report View
Holding down the Shift key and pressing Enter also saves the record you're
working on. Doug "Allen Browne" wrote in message ... 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. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Dave" wrote in message news:Kk0wc.4511$wS2.4462@okepread03... 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 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! |
Thread Tools | |
Display Modes | |
|
|