Changing Form Captions on the fly

  • Thread starter Thread starter RedHeadedMonster via AccessMonster.com
  • Start date Start date
R

RedHeadedMonster via AccessMonster.com

I have a form that pops up when you open a report. The form asks for Start
Date and End date that away your report will be for a User defined time
period. There are several reports that use this. Instead of creating a form
for each report I have one form that is triggered. The form is called for in
the On Open event of the report.
Is there a way to assign a caption to the form based on the Title of the
report thats opening it?
Thanx.

RHM
 
I have a form that pops up when you open a report. The form asks for Start
Date and End date that away your report will be for a User defined time
period. There are several reports that use this. Instead of creating a form
for each report I have one form that is triggered. The form is called for in
the On Open event of the report.
Is there a way to assign a caption to the form based on the Title of the
report thats opening it?
Thanx.

RHM

Sure. I'll assume you are opening this form in acDialog mode.

DoCmd.OpenForm "FormName", , , , , acDialog, Me.Name

Then code the form's Load event:
If Not IsNull(Me.OpenArgs) Then
Me.Caption = "Opened from " & Me.OpenArgs
End If
 
Fredg, You Rock! Thanx, worked perfectly.
Have a nice weekend!
RHM
I have a form that pops up when you open a report. The form asks for Start
Date and End date that away your report will be for a User defined time
[quoted text clipped - 6 lines]

Sure. I'll assume you are opening this form in acDialog mode.

DoCmd.OpenForm "FormName", , , , , acDialog, Me.Name

Then code the form's Load event:
If Not IsNull(Me.OpenArgs) Then
Me.Caption = "Opened from " & Me.OpenArgs
End If
 
Back
Top