Group:  Microsoft Access ยป microsoft.public.access.reports
Thread: Printing a report

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Printing a report
"dogbite via AccessMonster.com" <u26281[ at ]uwe> 23.09.2006 16:38:31
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

--
Message posted via http://www.accessmonster.com

Re: Printing a report
fredg <fgutkind[ at ]example.invalid> 23.09.2006 16:46:08
On Sat, 23 Sep 2006 16:38:31 GMT, dogbite via AccessMonster.com wrote:

[Quoted Text]
> 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:
Where Clause + Restrict data to a subset of records'
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Re: Printing a report
"dogbite via AccessMonster.com" <u26281[ at ]uwe> 24.09.2006 15:30:00
fredg wrote:
[Quoted Text]
>> 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:

syntax for this is: OpenReport(reportName,[View as acView = acViewNormal],
[WhereCondition])

not sure what you ment by >Where Clause + Restrict data to a subset of
records'
I get a compile error
expected end of statement


in table tblBvista the autoNumber name is RecordId
I allso have a text box on frmbvista that the control source is RecordId
from the table
Not sure I have VBA Help files
But I do have april 2001 MSDN library

IF you give me a little more help THEN
I might get it
Else I can do it with a Quary and a Macro
ElseIf anyone wants to do it with a qry & macro Then
Let me know and I"ll post it for you
end if
Thanks
Dogbite

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/200609/1

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net