Results 1 to 7 of 7
  1. #1
    Ferdi is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    4

    Selecting Items in a combo box

    Hi,

    If I select the product "orange" from a drop down list of a combo box how do i script that in the after update. The combo box is in a subform but I don't think that matters. Here is my sample code but its not working right.

    Dim strProd25 As String



    strProd25 = "Orange"

    If Me.ProductID.ItemData = ("Orange") Then
    Me.Parent!MechanicalSpreader.Value = True 'This is a check box
    Else
    MsgBox "Mechanical Spreader Method must be check"
    Me.ProductID.Undo
    Me.Undo
    End If

    Thanks

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    how do you script WHAT?

  3. #3
    Ferdi is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    4
    What I want to do is if I select "orange" in a combo box drop down then I want a check box to be checked.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by Ferdi View Post
    What I want to do is if I select "orange" in a combo box drop down then I want a check box to be checked.
    you have to check for the value:
    Code:
    after_update
    
    if me.combo = "orange" then
       me.checkbox = -1
    end if

  5. #5
    Ferdi is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    4
    Thanks I was wondering can you put this On-Click rather than after update. Is there a difference?

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by Ferdi View Post
    Thanks I was wondering can you put this On-Click rather than after update. Is there a difference?
    why? clicking a combo doesn't change the value. what's the point of that?

  7. #7
    Ferdi is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    4
    So what you r saying is that there is no difference where you put the code. If that is the case then thanks.

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

Similar Threads

  1. Replies: 4
    Last Post: 04-05-2011, 06:12 PM
  2. Items being removed from a Combo Box
    By viper in forum Forms
    Replies: 2
    Last Post: 10-14-2010, 08:30 AM
  3. Selecting multiple items from Dropdown
    By Kipster1203 in forum Forms
    Replies: 12
    Last Post: 06-07-2010, 09:20 AM
  4. Selecting Dates
    By jpalk in forum Queries
    Replies: 3
    Last Post: 05-21-2010, 06:08 AM
  5. Replies: 1
    Last Post: 11-11-2006, 08:23 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