Entering a Form name in coding

  • Thread starter Thread starter Beverly Darvill
  • Start date Start date
B

Beverly Darvill

I am trying to enter some code that validates fields but the form it comes
from contains spaces (Project Review Actions Closure Query) and one of the
field names contains a space how do I enter this information into the code so
it accepts it or do I have to do a lot of renaming?

Thanks
 
Ideally, you should never use a space in the name of a field or table. When
I feel I need a space for readability, I insert an underscore character (_).
However, you can get around this in code by wrapping the name of the table or
field in square brackets. The SQL string might look like:

strSQL = "SELECT [" & FieldName & "] FROM [" & TableName & "]"

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
Back
Top