Passing a string from a form's TextBox to a report's TextBox

J

John S. Ford, MD

I'm using Access 2000 and I understand that the OpenReport method doesn't
support the OpenArgs property.

I've read about a possible work-around this by storing a string in an
"invisible" TextBox on the calling form and having the report "extract" this
string for its own use.

My question is, how does a report refer to a control located on the form
that called it? Any help very much appreciated!

John
 
L

Larry Linson

In the appropriate event (probably Open or Load)

Dim MyData as String

MyData = Forms!frmMyCallingForm!txtMyInvisText

where, as you have probably guessed, frmMyCallingForm will be the name of
the Form from which you call the Report, and txtMyInvisText will be the name
of the invisible text box (it doesn't _have_ to be invisible, BTW). Forms
refers to Access' FormsCollection (the collection of Open forms), so you
can't close that Form before the Report runs, but you do need to make sure
it is not popup, modal, etc., or you will cover up part of the Report
on-screen.

Larry Linson
Microsoft Office Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top