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

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


I got it; I changed the name of the text field on the form and it works
now.  Jeeze, I never thought of section being a reserved word.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Nicholson,
Karen
Sent: Friday, September 10, 2004 3:19 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] Section is a Reserved Word? How to refer to a Field
ofThat Name


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


-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list