Call TextBox Value from Subform

indy.gill

New member
Local time
Today, 12:25
Joined
Jan 4, 2005
Messages
4
Hi

I have an Access 2002 Database that I am working on. I have a Form (FormX) which has a textbox on it which holds a value (200). FormX also has a subform on it called FormY. I would like to reference the value of the textbox which is on FormX from FormY.

I have added a button to FormY which calls the following sub:

Private Sub Command0_Click()
Dim str As String
str = [FormX].[Text1]
MsgBox "value from Form X = " & str
End Sub

However the above does not work, im not very familar with the Access Forms Syntax's, Im a bit of a newbie (I appologise if this is a easy question)

Thanks in advance
 
Thanks Peter it worked a treat... :)
 
Access a control in certain form in Access:

[Forms]![FormName].ControlName

For accessing property of certain form
[Forms]![FormName].FormpropertyName
 

Users who are viewing this thread

Back
Top Bottom