Results 1 to 7 of 7
  1. #1
    Stephenson is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    North West
    Posts
    110

    You Can't Assign A Value To This Object Troubles.


    Hello all,

    I'm using the following code to open a single form from a continuous form.

    Code:
    Private Sub tboHomeVendorID_DblClick(Cancel As Integer)
         DoCmd.OpenForm "frmVendor", , , , acFormAdd, acDialog, Me.VendorID
    End Sub
    And

    Code:
    Private Sub Form_Current()   
        If Me.NewRecord Then
              Me.tboVendorID = Me.OpenArgs
        End If
    End Sub
    Using this I get the error "You Can't Assign A Value To This Object"

    This is very frustrating because I'm currently using this same code to with other forms successfully.
    If I alter the code to open another form then it will work, therefore I have narrowed down that my problem is with frmVendor. My form is set to allow edits and there are no input masks.

    I've also created a new form with the same record source, tblVendor and have had no luck there either. tblVendor appears to be setup the same as my other tables so I'm at a complete loss as to where my problem is.

    Please oh please let me know if you see the error in my ways.

    Thank you for looking.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you manually enter a value in that textbox? Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Is tboVendorID bound to an autonumber field? You can't assign values to them. That's why they're 'auto', and take care of themselves.
    Last edited by davegri; 06-22-2016 at 09:33 PM. Reason: clarity

  4. #4
    Stephenson is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    North West
    Posts
    110
    Quote Originally Posted by davegri View Post
    Is tboVendorID bound to an autonumber field? You can't assign values to them. That's why they're 'auto', and take care of themselves.
    Davegri, you've hit the nail on the head here. I did not realize that, but that is exactly what I was trying to do.

    Now knowing this, how can I call my single for to the same record I double click on in my continuous form?

    Thank you for the help.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Stephenson is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    North West
    Posts
    110
    GREAT!

    Thank you for the help. I'll put this to work.

    Have a great day.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. You can't assign a value to this object error
    By bdicarlo1 in forum Forms
    Replies: 6
    Last Post: 11-18-2012, 10:21 AM
  2. Replies: 0
    Last Post: 05-16-2012, 01:48 PM
  3. You can't assign a value to this object
    By boywonder in forum Programming
    Replies: 1
    Last Post: 09-08-2011, 04:54 PM
  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