I have Access 2000 I want to print the current redordset on frmBvistaMain to
rptBvista. I've tryed several of the posts (code) but for some reason I can't
get them to work . I'd like to keep it as simple cause Me.notToSmart=
I'd be grateful for any help.
Thanks
re: print the current redordset
The current recordset is all of the records in the form.
I suspect you mean the current record.
Your table should have a unique prime key field.
In my example it is named [RecordID].
On the command button's property sheet write
[Event Procedure]
on the Click event line.
Then click on the little button with 3 dots that will appear on that
line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines write:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "rptBvista", acViewPreview, , "[RecordID] = " &
Me![RecordID]
The above assumes a [RecordID] field that is a Number Datatype.
If, however, [RecordID] is Text Datatype, then use:
DoCmd.OpenReport "rptBvista", acViewPreview, ,"[RecordID] = '" &
Me![RecordID] & "'"
For clarity, the single and double quotes are..
"Me![RecordID] = ' " & [RecordID] & " ' "
Change [RecordID] to whatever the actual field name is that you are
using.
See VBA Help files for: