Changing the caption properties on a form

  • Thread starter Thread starter rmd
  • Start date Start date
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?
 
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
 
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
 

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

Back
Top