Assigning values to txtBox on Reports using code

A

Ayo

how do I use this line of code:
Me.txtBeginDate.ControlSource=Mid(Me.OpenArgs, commaOne+1,(commaTwo-1)
-commaOne)
to assign value to txtBeginDate in a Report without getting the "Enter
Parameter Value" dialog window. The only other option I have left is to
convert the txtBeginDate txtBox into a label. Any other ideas.
Thank you.
 
J

Jeanette Cunningham

Hi Ayo,
Base the report on a query.
Use a form to pick up the BeginDate and use it for the query.

Jeanette Cunningham
 
A

Albert D. Kallal

When you write code and use events in a form, then any piece of code, and
any event or code anywhere in the former has full access to any control on
that form.

The city

the situation is rather different when you use code in a form, to use code
in a form and reference controls in a form

The situation is rather different when you use code in a report. T to use
controls reference controls in a report va code, you MUST use the
appropriate event. if you don't use the correct event in a report, you will
not have program it access to the actual controls them selves.

in other words if your code is going to modified some text box control in
the heading of the report, you must use the report on format event for the
heading.

What this means is your example code will function, but you can not use the
report's on open event (as you normally would say in the form).

So, you need to use the on format event of the detail section, or headder
section of your report.
 
A

Ayo

Thanks guys. But my problem was solved by converting the txtBoxes to labels
and using the code to assign the values. This worked great.
 

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