Results 1 to 7 of 7
  1. #1
    bdicarlo1 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    8

    Question You can't assign a value to this object error

    I have a Form and Subform. Whenever I start to update the subform section, I get the error "You can't assign a value to this object". When I click okay, I can then update the subform and my table is updated correctly. This error box only occurs when I initially try to update the subform, and any subsequent entry I make while keeping the form open is fine. It's just on the first attempt to update, and aside from the error popup box, I can't see where it's creating any problem.



    Possible causes listed in the error box are, 1) Object may be a control on a read-only form. 2) Object may be on a form that is open in design view. And 3) The value may be too large for this field.

    I can't see where any of these apply, especially since the records are updated correctly. Could there be something I'm overlooking which would cause this error?

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    What do you mean by 'update' - just type in data?
    Want to provide db for analysis? Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    bdicarlo1 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    8

    Database attached

    Thank you for check this database for me. 100-Select Form is my primary form. Subform is 101-Meeting Minutes. In main form, first select a Release and then Project ID from the dropdowns, then attempt to add Meeting Minute information. I usually select from the Application Dropdown in the subsection first, and this is where I get the error popup.

    Really appreciate this!!!

    - Ben
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    100-Select Form and Meeting Minutes subform have the same data source. Instead of using subform for Meeting Minutes just put the controls directly on the tab control page.

    None of these tables have a primary key defined. In which table should ProjectID be a unique ID?

    What is the App field for? It is in both Action Items and Meeting Minutes tables. Why does code set this field null on the main form?

    If you want the unbound comboboxes to serve as filter criteria for the main form recordset, there is no code to do that. So what is purpose of these comboboxes?

    Have you run Debug>Compile?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    bdicarlo1 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    8
    The table called Daily Status is imported from another source. It will contain all of the Project ID's and Release information. Each Project ID can be associated with one or two different Applications, so Project ID isn't necessarily a unique value all by itself. What I wanted to do is use that imported table for the user to select Release and Project ID. When entry is made to the subforms for Minutes or Action Items, it captures the selected Project ID....and the Application selected. The application dropdown is limited to the Applications associated with the Daily Status Table. If only one application is available, then there will only be one application in the dropdown for that Project ID. The final report captures meeting minutes by date range, and also any Open Action Items. Everything works perfectly except for that popup error. If I can get rid of that, the database is complete. This is the first full database I've written with Forms and Reports. I've only used Access to crunch numbers before. No Access or Database training of any kind, but if I can can get rid of that error....I'll consider this a pretty good accomplishment.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    That still doesn't explain why main form and sub form have same data source.

    I hope you don't plan to build queries that join Daily Status with the other tables.

    Master/Child linking should synchronize saving pk value into the fk field. Also, linking records to themselves just doesn't make sense and that is essentially the setup with this form/subform.

    What I did:

    1. Main form RecordSource
    SELECT DISTINCT [Project Id] FROM [Daily Status];
    Then removed the Me.App=Null lines from code

    2. Reset the MasterChild links properties of both subforms.

    3. Why are there multiple textboxes on subforms for ProjectID but all not visible? Removed the extras and removed the DefaultValue. I set to visible so I could see what was happening.

    4. Code to filter main form RecordSource
    Private Sub Project_ID_AfterUpdate()
    Me.FilterOn = False
    Me.Filter = "[Project ID]='" & Me.Project_ID & "'"
    End Sub

    BTW, advise not to use spaces, special characters, punctuation (underscore is exception) in names nor reserved words as names.
    Last edited by June7; 11-17-2012 at 11:55 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    bdicarlo1 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    8
    June7....Thank you for your help. I'll be honest, my knowledge and skills in database design are so limited, I didn't understand half of what you wrote, but I tried . Somehow I did get this working though. I went into my subforms and deleted out those hidden fields that you questioned. I'm not sure what I had them in there, but apparently they were not needed at all. I also went into my row source query for the application dropdown in both subforms, and removed the null iff condition. then i gave the application dropdowns an event procedure to refresh on GotFocus. The entire thing is now working as I had hoped, and I do appreciate your time here. I used what I understood, I've still got a lot of learning to do, but am so appreciative of this forum and the guidance you all provide. Not just this post/question, but others I've also asked, I couldn't have completed this without your help. My database integrety might not be totally up to par, but my boss will be extremely happy with the end result.

    - Ben

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 05-16-2012, 01:48 PM
  2. You can't assign a value to this object
    By boywonder in forum Programming
    Replies: 1
    Last Post: 09-08-2011, 04:54 PM
  3. Replies: 2
    Last Post: 07-13-2011, 06:23 AM
  4. Replies: 3
    Last Post: 04-15-2010, 09:43 AM
  5. Replies: 3
    Last Post: 03-30-2010, 01:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums