Results 1 to 13 of 13
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    #Name? problem (Access 2003 SP2)

    A client of mine has a text box on a form taht relates to a field in a sub form, it's controlsource is:

    =IIf([frm EEWR POs SF].[Form].[RecordsetClone].[RecordCount]=0,Null,[frm EEWR POs SF].[Form]![PO NUMBER])

    On their computer the text box shows #Name? for any record shown, on my computer it shows the correct value.

    Can someone help me here?

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: #Name? problem (Access 2003 SP2)

    Access 2003 treats references to Recordcount of a Recordset as "Potentially harmful" so does not allow it.

    So you must be using a different version of Access, or you have different security levels.

    To get around this, I use unbound textboxes, then set their value in code using the oncurrent event of the relevant form.
    Regards
    John



  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: #Name? problem (Access 2003 SP2)

    Thanks John, we must different security levels. What security levels are you referring to?

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

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: #Name? problem (Access 2003 SP2)

    This may not be a cause of your problem, but it is something you should be aware of if you already aren't.

    The 3rd part of your IIF statment "...,[frm EEWR POs SF].[Form]![PO NUMBER])" will get evaluated REGARDLESS of whether or not the recordcount=0! That is, Access evaluates all 3 parts of the IIF parameters, then calls IIF with these evaluated results.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: #Name? problem (Access 2003 SP2)

    Hans, are you suggesting that sandbox mode may be the problem?

    I can find nothing in the registry referring to sandbox.

    Thanks Mark for that info, but the problem is on one computer with Access 2003 SP2 and not on another with the same Access level.

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

    Re: #Name? problem (Access 2003 SP2)

    If the registry entry for SandBoxMode is not present, the Jet engine will use the default value 2. You could try creating the value on the problem PC and assign it the value 0 (this is the most permissive setting).

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: #Name? problem (Access 2003 SP2)

    Is there an easy way to do this rather than thru the registry where you can screw the registry?

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

    Re: #Name? problem (Access 2003 SP2)

    The attached zip file contains a .reg file. If the user double-clicks the .reg file, the registry entry will be set to 0 (and created if it doesn't exist yet),
    Attached Files Attached Files

  10. #10
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: #Name? problem (Access 2003 SP2)

    Thanks Hans, this is for a client.

    Will they need to save the registry before they apply this, just to be on the safe side?

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

    Re: #Name? problem (Access 2003 SP2)

    No, if it doesn't work out (i.e. it doesn't solve the problem), no harm is done.

  12. #12
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: #Name? problem (Access 2003 SP2)

    Thanks, I get bit paranoid times.

  13. #13
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: #Name? problem (Access 2003 SP2)

    Thanks to all who contributed to this.

    I have decided to go the populate an unbound (it was always unbound) text box thru the OnCurrent events of the main/sub forms involved.

    I had used DCount to test if there were records present or not, but this proved too slow so i went with a DAO recordset to test it instead, this is so much faster.

Posting Permissions

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