Results 1 to 2 of 2
  1. #1
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246

    VBA Code help

    I have Fields Form in this order:

    SubpartID
    PrimaryID
    Discription
    Qty
    UnitCost
    NetWght

    Here is the VBA Code:

    Private Sub cboSubpartID_Change()
    Me.PrimaryID = Me.cboSubpartID.Column(1)
    Me.Discription = Me.cboSubpartID.Column(3)
    Me.Qty = Me.cboSubpartID.Column(4)
    Me.UnitCost = Me.cboSubpartID.Column(5)
    Me.NetWght = Me.cboSubpartID.Column(7)
    End Sub

    Now the SubpartID is not coming up at all...Its registering the PrimaryID instead. So I changed the Column# Still only getting the PrimaryID number instead the correct one. I changed the lookup on the Table...Still not able to get the SubpartID to show up in the form...


    TIA For your Help!!

    Stephanie

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Recommend AfterUpdate event instead of Change.

    Make sure index references are correct.

    Column() index begins with 0. So if the value you want is in column 2 the index is 1.
    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.

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

Similar Threads

  1. Word code in Access - How to modify my current code
    By Alexandre Cote in forum Programming
    Replies: 0
    Last Post: 11-15-2010, 08:26 AM
  2. Code in combobox, code in text box
    By float in forum Forms
    Replies: 3
    Last Post: 09-29-2010, 07:12 AM
  3. Access 2003 code vs Access 2007 Code
    By ralphjramirez in forum Access
    Replies: 5
    Last Post: 11-23-2009, 12:33 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