Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    3

    Unanswered: AllowEdits in nested subdatasheets

    Within my main form I have four levels of nested datasheet. From the On_Load event of the main form, I call a procedure to turn on/off editing of the subdatasheets based on the login ID. I can only change the allowedits property of the highest level datasheet. If I try setting this property on any subdatasheet, I get message #2455, "You entered an expression that has an invalid reference to the property Form/Report." Here is the code I am using to set allowedits in a subdatasheet (fsubProjects is the top-level datasheet):

    Me!fsubProjects.Form!fsubProjections.Form.AllowEdi ts = False

    Is what I'm trying to do is possible? Can it be done from the load event of a form two or three levels up?

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Add 2 buttons on the main form form, one of them sets the allowedits to true, the other sets the allowedits to false. Test and see if that works. If it does, you may have some other coding conflicting elsewhere in code.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    May 2004
    Posts
    3
    You can set allowedits in a subdatasheet, but the nested subdatasheets cannot be referenced until they are actually opened (expanded). I had to move the code from the main form to the subdatasheet.

Posting Permissions

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