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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need Help with xxx.ControlSource

Status
Not open for further replies.

nethusiast

Programmer
Mar 12, 2009
1
US
I'm trying to compose an informational display that contains variables and post it into an Access field (named ReadMe). I get the error "#Name?" displayed in the field.

When I generate the same string and display it in a msgbox it works ok. You can see the msgbox statement commented out in the code below.

Can you tell me why the "Me!ReadMe.ControlSource = BMString" statement does not work in the following code? I created the message in several parts (BM1, BM2, etc.) only for debugging.

Private Sub BuildReadMe()
Dim BMString, NL, BM1, BM2, BM3, BM4, BM5
NL = Chr(13)
BM1 = "This procedure will create a backup file of your data and name it... "
BM2 = "'PWordsBkupDatayymmddhhmm'."

BM3 = "It will save the file in a database named... "
BM4 = "'" & BkupDbName & "'."

BM5 = "Click DoIT! to proceed."
BMString = BM1 & BM2 & NL & NL & BM3 & BM4 & NL & NL & BM5
' MsgBox (BMString)
Me!ReadMe.ControlSource = BMString
Refresh
EndSub
Thanks in advance...fab
 
vHow are ya nethusiast . . .

Try:
Code:
[blue]    Me!ReadMe = BMString[/blue]
You just have to call [blue]BuildReadMe[/blue] from code.

Note: You can only save the [blue]Control Source[/blue] property in design view!

[blue]Your Thoughts? . . .[/blue]

BTW: Welcome to [blue]Tek-Tips![/blue] [thumbsup2] Do have a look at one of the links at the bottom of my post. The links will help you [blue]ask better questions[/blue], get [blue]quick responses[/blue], [blue]better answers[/blue], and insite into [blue]etiquette[/blue] here in the forums. Again . . . Welcome to [blue]Tek-Tips![/blue] [thumbsup2] [blue]Its Worthy Reading![/blue]


See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top