Changing the caption properties on a form

R

rmd

Any input on the best method of having the caption properties change when
opening a form with a click event, to reflect the properties of 2 fields on
the 1st form, i.e. firstname lastname. to the 2nd form that opens?
 
A

Allen Browne

Pass the value for the Caption in the OpenArgs of the OpenForm statement,
e.g.:
DoCmd.OpenForm "Form2", OpenArgs:= Trim(Me.FirstName & " " & Me.Surname)

Then in the Open event of the receiving form, set the Caption to the
OpenArgs
If Len(Me.OpenArgs) > 0 Then
Me.Caption = Me.OpenArgs
End If
 
R

rmd

Thanks Allen.

I was able to make the OpenArgs work, but what I needed was the caption to
change on click event. So with what you supplied I altered it to work on
click event

"Forms![Form1].Caption = Trim([LastName] & " " & [FirstName] & " " &
[Weight])

I could of swore I tried this line before. Thanks a million for you Info
Allen.

Bob
 
Top