Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Assign combo box value based on unbound column?

Discussion in 'Information Technology' started by vavroom@gmail.com, Jul 28, 2006.

  1. vavroom@gmail.com

    vavroom@gmail.com
    Expand Collapse
    Guest

    Hmm, not the clearest subject line. Let's see if I can make it
    clearer.

    I have frmApplication, based on tblApplication.

    tblApplication contains fldConcat, fldLocation, fldMode and a few
    others.

    fldLocation and fldMode are looking up values from a "dictionary"
    table, so Location will always be the same. the values of fldLocation
    come from tblLocation.

    frmApplication displays those three fields.

    I want the values of fldLocation and fldMode to default to the
    appropriate values, based on fldConcat.

    fldConcat would have a typical value of "110100 0601 E 33"

    Using split() I am able to retrieve the information I want from Concat,
    so for example, I can get a string that tells me that location=33

    How would I pass that information to fldLocation, considering that 33
    is the value of colum(3)???

    I've considered doing a dlookup, looking up the primary key of the
    record in tblLocation based on the string returned from the split(),
    but wouldn't there be an easier, more "elegant" way?
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Sikh diaspora condemn Bhutto's assignation (ANI via Yahoo! India News) Breaking News Dec 28, 2007
    Sikh News Punjab & Sind Bank assigned A1+ for Rs 1,000 cr deposit prog (Deepika) Breaking News Oct 17, 2007

  3. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    cboMyCombo.Column(2)
    Would return the third field (combo's are 0 based)

    HTH
    Pieter
    <vavroom@gmail.com> wrote in message
    news:1153179603.691415.305850@p79g2000cwp.googlegroups.com...
    > Hmm, not the clearest subject line. Let's see if I can make it
    > clearer.
    >
    > I have frmApplication, based on tblApplication.
    >
    > tblApplication contains fldConcat, fldLocation, fldMode and a few
    > others.
    >
    > fldLocation and fldMode are looking up values from a "dictionary"
    > table, so Location will always be the same. the values of fldLocation
    > come from tblLocation.
    >
    > frmApplication displays those three fields.
    >
    > I want the values of fldLocation and fldMode to default to the
    > appropriate values, based on fldConcat.
    >
    > fldConcat would have a typical value of "110100 0601 E 33"
    >
    > Using split() I am able to retrieve the information I want from Concat,
    > so for example, I can get a string that tells me that location=33
    >
    > How would I pass that information to fldLocation, considering that 33
    > is the value of colum(3)???
    >
    > I've considered doing a dlookup, looking up the primary key of the
    > record in tblLocation based on the string returned from the split(),
    > but wouldn't there be an easier, more "elegant" way?
    >
     
  4. vavroom@gmail.com

    vavroom@gmail.com
    Expand Collapse
    Guest

    Pieter Wijnen wrote:
    > cboMyCombo.Column(2)
    > Would return the third field (combo's are 0 based)
    >


    Hello Pieter,

    yes, i knew that, that's not the question, I don't think. I don't want
    to return the field. i want to assign a record based on the field in
    question.

    So, if the values of the combo box are:
    1, Moncton, 22
    2, Sydney, 44
    3, Wellington, 33

    Where the first column is the primary key/bound column.

    I want to default the combo box to the relevant bound column based on
    matching the value of the 3rd column.

    As an aside, I'm having the damndest time trying to get dlookup going :(
     
  5. vavroom@gmail.com

    vavroom@gmail.com
    Expand Collapse
    Guest

    Ok, well, I've got it going using dlookup (tricky, having to use
    mixture of double and single quotes, I *never* remember the order or
    the logic behind it, but it is working now...).

    So, that makes me happy, thanks for helping me talking it through :)
     
  6. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Sorry,
    I didn't read you correctly
    BTW
    I never use the Domain aggregate functions anyway (DLookUp, DSum, DCount) As
    they are notoriously slow
    It takes a bit longer to program, but I use Recordsets (& Qdefs instead)
    Also I always use ' for text field enclosures to avoid """" constructs (very
    hard to read/debug)
    Pieter

    <vavroom@gmail.com> wrote in message
    news:1153182537.855522.91070@i42g2000cwa.googlegroups.com...
    > Ok, well, I've got it going using dlookup (tricky, having to use
    > mixture of double and single quotes, I *never* remember the order or
    > the logic behind it, but it is working now...).
    >
    > So, that makes me happy, thanks for helping me talking it through :)
    >
     
  7. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Sorry,
    I didn't read you correctly
    BTW
    I never use the Domain aggregate functions anyway (DLookUp, DSum, DCount) As
    they are notoriously slow
    It takes a bit longer to program, but I use Recordsets (& Qdefs instead)
    Also I always use ' for text field enclosures to avoid """" constructs (very
    hard to read/debug)
    Pieter

    <vavroom@gmail.com> wrote in message
    news:1153182537.855522.91070@i42g2000cwa.googlegroups.com...
    > Ok, well, I've got it going using dlookup (tricky, having to use
    > mixture of double and single quotes, I *never* remember the order or
    > the logic behind it, but it is working now...).
    >
    > So, that makes me happy, thanks for helping me talking it through :)
    >




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4231 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     
  8. vavroom@gmail.com

    vavroom@gmail.com
    Expand Collapse
    Guest


    > Sorry, I didn't read you correctly


    No problem, I was probably not clear to start with :)

    > I never use the Domain aggregate functions anyway (DLookUp, DSum, DCount) As
    > they are notoriously slow
    > It takes a bit longer to program, but I use Recordsets (& Qdefs instead)


    Yeah, well, it does seem like it would be "cleaner" and more effective,
    except that one codes to one's level. I'm not a code jockey, not by
    any stretch of the imagination. I'm not a programmer, I do this "on
    the side", and while I'm relatively able to understand what code does,
    and recycle bits and bobs, writing things up with recordsets &qdefs is
    just outside my realm of experience. <shrug>
     

Share This Page