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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|