Access Report

benny2707
04-17-2004, 02:31 PM
I'm getting really annoyed with this report im doing in access!!!! Please help...

Basically i have a form where u can scroll through various records, and when u get to one u want to print u can press a button to open a report which outputs the data. i have used unbound textboxes on the report and linked them using

form_load()
text1.setfocus
text1 = form_whatever.text1.text

but this hasnt worked, the text boxes are just blank. what am i doing wrong???

couch612
04-18-2004, 06:19 PM
ok you need to go about this in a different way.

Create your Report object based on the same table or query that your form is based on. I don't know what fields you have in your table/query, so I will assume you have a numeric field named [Record ID], and a text box on your form that is bound to the [Record ID] field named txtRecordID. Then in the Click event of the command button on your form, you would open the report object like so:



sub CommandPrint_Click()

docmd.openReport "myReport", acViewPreview, , "[Record ID] = " & txtRecordID

end sub

benny2707
04-19-2004, 02:41 AM
Success!!!! Thanks so much peter, that has solved a major (and very annoying) problem!!!

couch612
04-19-2004, 04:56 PM
I'm very glad I could help you out Benny :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum