Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a referencing issue... 1

Status
Not open for further replies.

thefear

Technical User
Mar 24, 2004
20
hiya folks!

okay, I'm not sure how to articulate this problem but it should be straightforward if I just tell you what I'm trying to do.

In vba, I can do this...

Dim stDocName As String

stDocName = "frmTestForm"
DoCmd.OpenForm stDocName

...that is, refer to "frmTestForm" as "stDocName" in order to open a form.


How come I then can't refer to the form like this...?

forms!stDocName!txtTest = "something"

When I try, I'm told form 'stdocname' isn't found.

Any ideas/epiphanies would be appreciated :eek:)
 
Try this method of referencing:

[tt]forms(stDocName).controls("txtTest")[/tt]

Roy-Vidar
 
Thankyou RoyVidar! This little niggle has been a thorn in my side for a while now. I'm going to name my first-born after you :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top