Setting a textbox's default value with a variable

S

Steve P

I'm trying to programmatically set a textbox's default value with a variable
and it won't work. Here's the example given in the help menu:

Me("text92").DefaultValue = """default value"""

Why do you need 3 quotes on either side of the string?

How do i replace the "default value" with a variable? What syntax should i
use?
 
J

John Spencer

Me("text92").DefaultValue = Chr(34) & strVariable & Chr(34)

The quotes are needed since the DefaultValue property is a string property.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

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