A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

New record data is empty in Report View



 
 
Thread Tools Display Modes
  #1  
Old June 4th, 2004, 04:13 PM
Dave
external usenet poster
 
Posts: n/a
Default 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  
Old June 4th, 2004, 04:18 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default 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

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!


  #3  
Old June 4th, 2004, 04:31 PM
Tasha
external usenet poster
 
Posts: n/a
Default 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  
Old June 4th, 2004, 11:28 PM
Doug Munich
external usenet poster
 
Posts: n/a
Default 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

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!




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.