Attach Event to Unbound Text Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an unbound text box on a report that shows the date from data typed in
an unbound text box on the form (menu) from which the report is opened. The
info from this text box on the menu is also used in some underlying queries
and effects the data on several reports incuding this one.
So, I wanted the date to show up on the report so users would understand
their data is as of that particular date.
It is setup such as...form![Menu].[Text1] This works fine...except, if
the user fails to type the date in the text box on the menu; I'd like it to
tell the user so they know why their report has a blank column.

Can I somehow attach an event to the unbound text box. So, if it is blank
it will print somehting such as...."No Date for Data Enter"

Thank you
 
neenmarie said:
I have an unbound text box on a report that shows the date from data typed in
an unbound text box on the form (menu) from which the report is opened. The
info from this text box on the menu is also used in some underlying queries
and effects the data on several reports incuding this one.
So, I wanted the date to show up on the report so users would understand
their data is as of that particular date.
It is setup such as...form![Menu].[Text1] This works fine...except, if
the user fails to type the date in the text box on the menu; I'd like it to
tell the user so they know why their report has a blank column.

Can I somehow attach an event to the unbound text box. So, if it is blank
it will print somehting such as...."No Date for Data Enter"


There are no events for controls in a report. You can do
everthing in the Format event of the section containing the
control.

OTOH, your question does not require an event. You can do
this in an expression in the text box's control source:

=IIf(Forms!Menu.Text1 Is Null, "No Date for Data Enter",
"Starting Date: " & Format(Forms!Menu.Text1, "d mmm yyyy"))
 
Thank you very much.....perfect

Marshall Barton said:
neenmarie said:
I have an unbound text box on a report that shows the date from data typed in
an unbound text box on the form (menu) from which the report is opened. The
info from this text box on the menu is also used in some underlying queries
and effects the data on several reports incuding this one.
So, I wanted the date to show up on the report so users would understand
their data is as of that particular date.
It is setup such as...form![Menu].[Text1] This works fine...except, if
the user fails to type the date in the text box on the menu; I'd like it to
tell the user so they know why their report has a blank column.

Can I somehow attach an event to the unbound text box. So, if it is blank
it will print somehting such as...."No Date for Data Enter"


There are no events for controls in a report. You can do
everthing in the Format event of the section containing the
control.

OTOH, your question does not require an event. You can do
this in an expression in the text box's control source:

=IIf(Forms!Menu.Text1 Is Null, "No Date for Data Enter",
"Starting Date: " & Format(Forms!Menu.Text1, "d mmm yyyy"))
 
Back
Top