Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Synchronizing 2 combo boxes (2000)

    I have 2 combo boxes that I would like to synchronize. The first control (combochar) comes from a code table and consists of two numbers followed by a dash followed by two numbers, called 5charPIN. Example: 02-24. The second (combo88) is a longer series of numbers with dashes in between, called a PIN number. Example: 02-24-10-1000. In my form, I have the first combo box going to the code table, and in After Update, I have the following code:

    Dim strSQL
    Dim varpin

    varpin = Me!combochar

    strSQL = "Select [2002 Levy Data].[PIN] from [2002 Levy Data] Where [2002 Levy Data].[5charPIN] = " & varpin

    Me!Combo88.RowSourceType = "Table/Query"
    Me!Combo88.RowSource = strSQL

    The second combo box is not working. If I have the properties box open while I try this, if you go to the Row Source on the second combo - combo88 - the select statement is correct, but if I go to the query by clicking the .. , it shows it as a number, cutting of the beginning zeros. Example: 02-02 shows up as 2-2. If I change it to 02-02, it shows the right records.

    Help!

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Synchronizing 2 combo boxes (2000)

    >>strSQL = "Select [2002 Levy Data].[PIN] from [2002 Levy Data] Where [2002 Levy Data].[5charPIN] = " & varpin<<

    I suspect your problem comes from the end of your string. Varpin is a text string, so it needs to be surround by quotes (or double quotes). Change your string to this:
    ...Where [2002 Levy Data].[5charPIN] = " & chr(34) & varpin & chr(34)
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Synchronizing 2 combo boxes (2000)

    Thank you, thank you, thank you! It works now!

    <img src=/S/groovin.gif border=0 alt=groovin width=21 height=21>

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Synchronizing 2 combo boxes (2000)

    re: Thank you, thank you, thank you! It works now!

    You're welcome, though even 2 thank you's would be more than enough!<g>
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •