Caption Source....

MikeUK

Registered User.
Local time
Today, 13:36
Joined
Dec 14, 2000
Messages
36
i have a 2 forms.
on1 there are numerous buttons and a text box to enter a name.
on the other form there is a caption, which will show the name that was entered on the other form.
(it is not a text box because then it may be edited)

is there code that can be entered either behind the text box, or behind the caption, that will ensure that the text in the caption is the text that was entered on the form with the name text box??

thanx
:cool:
 
In the Load event of the form,

Me.SomeLabelControl.Caption = Forms!YourOtherForm!SomeControlName
 
thanx, ill try that tomorow when i have a chance, ill post back here if i have any trouble.
thanx
 
rite i tried ure code, but im not sure if ive done it right, it doesnt work so i assume that ive got it wrong.


Private Sub Label3_Click()
Me.Label3.Caption = Forms!Form3!Text1
End Sub


"label 3" is the caption i want the data to be displayed in

"Form3" is where the name was typed
it was typed in the text box named "text1"

i dont think ive interpreted the cod euve given me! can u help me out plz....... :D
 
The form named "Form3" must be open when the value is referenced .....

I don't know why you are using the "On Click" event of a label to do this .. but maybe this will give you direction.

You may instead want to use the Open Args of the DoCmd.OpenForm method to do this.

In the code that opens the form in question use this example:
DoCmd.OpenForm , "FormNameHere", , , , , Me.ControlNameHere
(Change the object names as needed)

Now in the form that's being opened .....
Use the forms' On Open event:

Private Sub Form_Open(Cancel As Integer)
If Not IsNull(Me.OpenArgs) Then
Me.Label3.Caption = Me.OpenArgs
End If
End Sub

HTH
RDH
 

Users who are viewing this thread

Back
Top Bottom