Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    I have the following code in a form and it works OK:

    Forms(gloGetValue("ParentFormName"))![curFee] = Nz(DSum("[curFees]", "tblPFees_Eng", _
    "[tblPFees_Eng].[lngPermitID] = Forms![frm_Permit_Eng_ACD].[lngPermitID] and [tblPFees_Eng].[lngFeeTypeID] " _
    & " = GetPref('Building Fee ID')"), 0)

    I

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Need Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    If I understood your request correctly, try this:


    Forms(gloGetValue("ParentFormName"))![curFee] = Nz(DSum("[curFees]", "tblPFees_Eng", _
    "[tblPFees_Eng].[lngPermitID] = Forms(gloGetValue('ParentFormName'))![lngPermitID] and [tblPFees_Eng].[lngFeeTypeID] " _
    & " = GetPref('Building Fee ID')"), 0
    Charlotte

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Hi Charlotte

    I'm still getting RTE with following code:

    Forms(gloGetValue("ParentFormName"))![curFee] = Nz(DSum("[curFees]", "tblPFees_Eng", "[tblPFees_Eng].[lngPermitID] = Forms(gloGetValue('ParentFormName'))![lngPermitID] and [tblPFees_Eng].[lngFeeTypeID] " & " = GetPref('Building Fee ID')"), 0)

    See attached error message, hope I sent this right

    Other sugestions?

    Thanks John
    Attached Files Attached Files

  4. #4
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    As an aside:-

    There is now Jet SP8 available. Jet SP7 seemed to be problematical so updating that might be a good plan?
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Try

    Forms(gloGetValue("ParentFormName"))![curFee] = Nz(DSum("[curFees]", "tblPFees_Eng", "[tblPFees_Eng].[lngPermitID] = " & Forms(gloGetValue("ParentFormName")).Controls("lng PermitID") & " and [tblPFees_Eng].[lngFeeTypeID] " & " = GetPref('Building Fee ID')"), 0)

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Thanks Charlotte & Hans

    That got it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •