Pass inverted comma as a string

K

Ken Snell

You mean the ' character?

What do you mean, "pass it"? Give us an example of what you're trying to do.
 
A

Archie

Thank you and a happy new year.
I want to use an Input Box to set the default value in a
combo accepting text in a form.
If the default value is not enclosed within " ", then an error results.
Trying to concatenate " does not work.
Alternately, the user can be asked to enter the default
value enclosed in inverted commas.
Most users can be expected to forget / overlook this instruction.
Is there any way that the user specified text can be
automatically enclosed in inverted commas "", when passing
this value to the combo box?
 
K

Ken Snell

If you want to do this in code, use a code step similar to the following:

Me.txtBoxName.DefaultValue = """" & _
InputBox("Enter the starting value for txtBoxName:") & _
""""

Or, you can use an expression similar to this in the Default Value property
of the text box (open form in design view, click on the textbox control,
open the Properties window, click on Data tab, and click in the Default
Value box):
=InputBox("Enter the starting value for txtBoxName:")
 

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