Results 1 to 2 of 2
  1. #1
    PinkLady50 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    171

    Multiple Actions On_Click won't work

    I have a form with two sections. The top of the form uses a combobox to get the Contract Number. I have an On_Click that I am using to display the Contractor and Name of MATO (Contract Name) but it will only pick up one field.



    Code:
    SELECT tblContractLevelMATO.[Contract Number], tblContractLevelMATO.[Name of MATO], tblContractLevelMATO.Contractor FROM tblContractLevelMATO ORDER BY tblContractLevelMATO.[Contract Number] DESC;
    Private Sub Contract_Number_Click()
    Me.MATO_Name = Me.Contract_Number.Column(2)
    Me.Contractor = Me.Contract_Number.Column(3)
    End Sub

    Is there a better way to get corresponding data into these text boxes besides using an On_click procedure?

    I have another part of the form where I will be using this logic as well. Once I select a Task Order I need to display 9 fields from the table that match that Task Order Number in various textboxes on the form.

  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
    I'd use the after update event. The column property is 0 based, so you'd want 1 and 2, not 2 and 3.
    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. Replies: 2
    Last Post: 08-07-2015, 10:15 AM
  2. Replies: 18
    Last Post: 06-22-2012, 12:49 PM
  3. Help with actions
    By xdeimusx in forum Access
    Replies: 7
    Last Post: 09-12-2011, 10:34 PM
  4. Macro with 3 actions
    By seweryng in forum Access
    Replies: 4
    Last Post: 01-20-2011, 10:15 AM
  5. Replies: 6
    Last Post: 11-16-2010, 02:38 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