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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Trying to Preview current record on form in a report



 
 
Thread Tools Display Modes
  #1  
Old August 8th, 2008, 03:29 PM posted to microsoft.public.access.reports
[email protected]
external usenet poster
 
Posts: 2
Default Trying to Preview current record on form in a report

Hi All,

I have been trying to create a button on a form that will populate a
report with only the current record's info. I have tried using this
code,

DoCmd.OpenReport "rptJacket", acViewPreview, , "[VUCaseFile] = '" &
[VUCaseFile] & "'"

VUCaseFile is an automatically generated alpha-numeric field. When i
click the button i get a dialog box asking for a parameter value for
VUCaseFile. I type in the case file (which is in the format VU08-000)
and the report opens, but there is no data.

What am I doing wrong? and is there anyway that Access can use the
current VUCaseFile on the form?

Any help would be GREATLY appriciated!!

Litedread
  #3  
Old August 18th, 2008, 02:25 PM posted to microsoft.public.access.reports
[email protected]
external usenet poster
 
Posts: 2
Default Trying to Preview current record on form in a report

On Aug 8, 3:01*pm, Marshall Barton wrote:
wrote:
I have been trying to create a button on a form that will populate a
report with only the current record's info. I have tried using this
code,


DoCmd.OpenReport "rptJacket", acViewPreview, , "[VUCaseFile] = '" &
[VUCaseFile] & "'"


VUCaseFile is an automatically generated alpha-numeric field. When i
click the button i get a dialog box asking for a parameter value for
VUCaseFile. I type in the case file (which is in the format VU08-000)
and the report opens, but there is no data.


What am I doing wrong? and is there anyway that Access can use the
current VUCaseFile on the form?


The VUCaseFile **field** must be in the report's record
source table/query.

Also make sure that the form record was saved before opening
the report. *If there is no other mechanism saving the
record, the use:
* * * * If Me.Dirty Then Me.Dirty = False

--
Marsh
MVP [MS Access]


Thanks Marsh!!

Cant believe it was that simple. Just added the VUCaseFile field to
the query and it worked like a charm.
Once again, 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 03:30 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.