Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I have highlighted the mistake in red:

    Private Sub SiteSelect_AfterUpdate()
    Me![Address] = Me.SiteSelect.Column(2)
    Me![AssignedTechs] = Me.SiteSelect.Column(3)
    If Me.SiteSelect = "Brandon, MB" Then
    Me.Dispatch2.Visible = True
    Else
    Me.Dispatch2.Visible = False
    End If


    That is referencing the first column, site ID. To reference the second column, contaning the text value, use Me.SiteSelect.Column(1)




  2. #17
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    Awesome! I knew it would be something simple like that. You da man!

  3. #18
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    Quote Originally Posted by John_G View Post
    I have highlighted the mistake in red:

    Private Sub SiteSelect_AfterUpdate()
    Me![Address] = Me.SiteSelect.Column(2)
    Me![AssignedTechs] = Me.SiteSelect.Column(3)
    If Me.SiteSelect = "Brandon, MB" Then
    Me.Dispatch2.Visible = True
    Else
    Me.Dispatch2.Visible = False
    End If


    That is referencing the first column, site ID. To reference the second column, contaning the text value, use Me.SiteSelect.Column(1)


    I am trying to add one more variable to the code above to where the same trigger happens when 2 items are selected from a dropdown. I tried listing them separately but it doesn't work:
    If Me.SiteSelect.Column(1) = "Brandon, MB" Then
    Me.Dispatch2.Visible = True
    Me.Dispatch1.Visible = False
    Else
    Me.Dispatch2.Visible = False
    Me.Dispatch1.Visible = True
    End If
    If Me.SiteSelect.Column(1) = "Linwood, MB" Then
    Me.Dispatch2.Visible = True
    Me.Dispatch1.Visible = False
    Else
    Me.Dispatch2.Visible = False
    Me.Dispatch1.Visible = True
    End If


  4. #19
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You can only make one selection from a combobox control.

  5. #20
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    Im not tying to select 2 things from the drop down I'm trying create a trigger based on two different selections in a drop down. Is ther an OR or a wildcard ( ex: *MB since both options have MB in them) statement perhaps that will trigger the same event if either options are selected from the drop down?

  6. #21
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Something like this might work ...
    Code:
    If Me.SiteSelect.Column(1) = "Brandon, MB" Or Me.SiteSelect.Column(1) = "Linwood, MB" Then
    Me.Dispatch2.Visible = True
    Me.Dispatch1.Visible = False
    Else
    Me.Dispatch2.Visible = False
    Me.Dispatch1.Visible = True
    End If

  7. #22
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    I tried that actually before I posted. For some reason it doesnt like the OR statement in that syntax. Any other suggestions?

  8. #23
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    That IF statement should work - the syntax is fine. What was the error message?

    Can you post the code that is giving you an error?

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-03-2015, 10:16 AM
  2. Replies: 2
    Last Post: 08-27-2014, 08:19 AM
  3. Replies: 5
    Last Post: 04-09-2014, 06:57 PM
  4. More Info" button based on Combo Box selection
    By kriskeven in forum Access
    Replies: 1
    Last Post: 05-21-2012, 02:23 PM
  5. Replies: 6
    Last Post: 03-10-2011, 11:31 AM

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