Adds single quotes around the passed value. Quotes are escaped, so for example if the value O'Leary was passed, the result would be 'O''Leary'. This form of escaping is supported by JET and MSSQL Server. The value NULL returns empty quotes (ie. ''). Using the q() function also protexcts from SQL injection attacks and results in more readable code.
The variant value to quote
1 | Docmd.RunSQL "UPDATE tblSample SET SampleCount=1 WHERE Gender=" & q(nz( Me .cboGender)) |