[AccessD] Section is a Reserved Word? How to refer to a Field of That Name

Nicholson, Karen cyx5 at cdc.gov
Fri Sep 10 14:18:49 CDT 2004


This code works and compiles just fine:

        If ([Forms]![frmASRSSectInit].[RequestType] <> "site audit" _
        And [Forms]![frmASRSSectInit].[Status] = "Open" _
        And [Forms]![frmASRSSectInit].[ysnCBRNTest] = 0 _
        And Not IsNull([Forms]![frmASRSSectInit].[ASSectCompletedDate]))
_
        And IsNull([Forms]![frmASRSSectInit].[CBRN_FinalTestReport]) _
        Then
        [Forms]![frmASRSSectInit].[ysnCBRNTest] = -1
        End If

However, there is a numeric field in my table and on my form named:
Section.  It must be a reserved word, because when I change the code to
specify that the section should equal 2, I get a compile error, argument
not optional.  Yikes!  A Friday headache is upon me.  What ever can I do
to get around this?  I can't change the field name as it is an SQL
backend and the damn would break.

        If ([Forms]![frmASRSSectInit].[RequestType] <> "site audit" _
        And [Forms]![frmASRSSectInit].[Status] = "Open" _
        And [Forms]![frmASRSSectInit].[ysnCBRNTest] = 0 _
        And [Forms]![frmASRSSectInit].[Section] = 1 _
        And Not IsNull([Forms]![frmASRSSectInit].[ASSectCompletedDate]))
_
        And IsNull([Forms]![frmASRSSectInit].[CBRN_FinalTestReport]) _
        Then
        [Forms]![frmASRSSectInit].[ysnCBRNTest] = -1
        End If

Karen Nicholson
National Laboratory
Xerox Global Services





More information about the AccessD mailing list