Access/VBA Library

Quote

Puts quotes around a String or numeric expression and returns the result.

Syntax

Quote( expression [, theQuote] )
Parameters
Name Type Description
expression Variant Required. The expression to be quoted.
theQuote Variant Optional. The quote to be put around expression.
Default: "'"
Return value

String : A String containing the quoted expression. When expression is Null the string "Null" is returned.

Code
Function Quote(expression, _
                Optional ByVal theQuote = "'") _
                As String
  If IsNull(expression) Then
    Quote = "Null"
  Else
    Quote = theQuote & expression & theQuote
  End If
End Function

Stringtag:StringSQLtag:SQL

Remarks

  • This function is usefull to create values in SQL statements.