Passing a variable to a subform

H

H. Martins

This is the first time I am using a subform (Access 2003).

Dim strText as String

strText = "whatever"
txtbxMemo.Value = strText

"whatever" apears in txtbxMemo located in current form.

Then I moved txtbxMemo to a subform of the current form. The subform
is called sfrmListaAlunosAccao

How do I write strText to txtbxMemo ?

Thanks
Henry
 
H

H. Martins

So,

Dim strText as String

strText = "whatever"
txtbxMemo.Value = strText

# in a subform should be like:

Dim strText as String

strText = "whatever"
Me!sfrmListaAlunosAccao.form!txtbxMemo.Value = strText

# ... but it doesn't work !

HM.
 
R

ruralguy via AccessMonster.com

Your syntax is correct *IF* sfrmListaAlunosAccao is the name of your
SubFormControl. Forms are displayed on other form by means of a
SubFormControl. This control is not required to have the same name as the
form it is displaying. It is the SubFormControl's name that is in the syntax
to reference a control on a subform. You know you are looking at the
SubFomrControl properties sheet if you can see the LinkChild/MasterFields
properties.
 

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

Top