Assign combo box value based on unbound column?

  • Thread starter Thread starter vavroom
  • Start date Start date
V

vavroom

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?
 
cboMyCombo.Column(2)
Would return the third field (combo's are 0 based)

HTH
Pieter
 
Pieter said:
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 :(
 
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 :)
 
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
 
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

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 :)



--
 
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>
 
Back
Top