Pass inverted comma as a string

  • Thread starter Thread starter Archie
  • Start date Start date
You mean the ' character?

What do you mean, "pass it"? Give us an example of what you're trying to do.
 
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?
 
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:")
 
Back
Top