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  

recordset's current position



 
 
Thread Tools Display Modes
  #1  
Old February 8th, 2007, 11:41 AM posted to microsoft.public.access.reports
85ascMcLaren
external usenet poster
 
Posts: 12
Default recordset's current position

Anyway I can pass ONLY the current record in a recordset to a report instead
of the whole recordset...

Something like ....
while not rs.eof do
'open report'
.movenext
loop

And in the report open, I can set the recordsource to that record only.
If I set it to the 'rs' (me.recordsource = rs), it will grab the entire
recordset, which is NOT what I want.... I do not if the absolute position
will work or SOME property like that , which I can append to the
(me.recordset = rs.(SOME PROPERTY WHICH ONLY GIVES THE CURRENT RECORD IN THE
RECORDSET)...

The long way is to assign individual text boxes to the rs.field during the
detail print section. Looking for a much shorter way as I described
above......

Thanks,
Jason

  #2  
Old February 8th, 2007, 12:55 PM posted to microsoft.public.access.reports
BruceM
external usenet poster
 
Posts: 723
Default recordset's current position

If you mean you are looking at a record on a form, and want to open a report
to that record, a command button click event could have something like:

If Me.Dirty Then Me.Dirty = False

Dim strRpt As String
Dim strLink As String

strLink = "[KeyField]=" & Me.[KeyField]
strRpt = "ReportName"
DoCmd.OpenReport strRpt, acPreview, , strLink

The command button wizard will produce a similar result. I'm not sure if
the Me.Dirty line of code is necessary, but it doesn't hurt. KeyField would
be the primary key field (or other unique field). The code assumes KeyField
is a Number field. If it is a text field it would be:

strLink = "[KeyField]=""" & Me.[KeyField] & """"

"85ascMcLaren" wrote in message
...
Anyway I can pass ONLY the current record in a recordset to a report
instead
of the whole recordset...

Something like ....
while not rs.eof do
'open report'
.movenext
loop

And in the report open, I can set the recordsource to that record only.
If I set it to the 'rs' (me.recordsource = rs), it will grab the entire
recordset, which is NOT what I want.... I do not if the absolute position
will work or SOME property like that , which I can append to the
(me.recordset = rs.(SOME PROPERTY WHICH ONLY GIVES THE CURRENT RECORD IN
THE
RECORDSET)...

The long way is to assign individual text boxes to the rs.field during the
detail print section. Looking for a much shorter way as I described
above......

Thanks,
Jason



  #3  
Old February 8th, 2007, 12:56 PM posted to microsoft.public.access.reports
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default recordset's current position

Jason

?recordset? ?current record?

You've described a "how"... where's the "what"?

You posted in a "reports" newsgroup.

What data are you working with? What do you want to accomplish?

--
More info, please ...

Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/

"85ascMcLaren" wrote in message
...
Anyway I can pass ONLY the current record in a recordset to a report

instead
of the whole recordset...

Something like ....
while not rs.eof do
'open report'
.movenext
loop

And in the report open, I can set the recordsource to that record only.
If I set it to the 'rs' (me.recordsource = rs), it will grab the entire
recordset, which is NOT what I want.... I do not if the absolute position
will work or SOME property like that , which I can append to the
(me.recordset = rs.(SOME PROPERTY WHICH ONLY GIVES THE CURRENT RECORD IN

THE
RECORDSET)...

The long way is to assign individual text boxes to the rs.field during the
detail print section. Looking for a much shorter way as I described
above......

Thanks,
Jason


 




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 05:14 AM.


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