[AccessD] length of combo box choice (long...sorry)

John Clark John.Clark at niagaracounty.com
Fri Feb 7 13:47:00 CST 2003


Last week or so, I was on the list, asking about a combo box
w/"sections." I am back on that project, after some diversions. I've got
the box to work...but...by work I only mean that my combobox gives me
the "look" that I am going for. However, I have two problems to finish
it up.

The first problem may be beat already. I used the Lebans' code, and it
didn't seem to provide for sending the info to the control source in the
table. Actually, it probably did, if you wanted to use exactly what was
listed in the box. However, I have what looks to be, "repeat data" in my
combo box:

DENIED / WITHDRAWN
   HR        
   ADC       
   MA
   NPA FS    
GRANT REDUCTION
   HR        
   ADC       
   MA
   NPA FS    
CASES W/NO ERRORS FOUND
   HR        
   ADC       
   MA
   NPA FS    

Because of this data being like this (i.e. "HR" under the heading
"DENIED / WITHDRAWN" is not the same as "HR" under the heading "GRANT
REDUCTION") they must have different designations, so I cannot use "HR".
Easy enough...use an autonumber or some other key value...but it didn't
originally provide for this. Instead of just using the query name for
the control source, I used "SELECT DISTINCTROW
[qryResultsCBO].[RESULTS], [qryResultsCBO].[kID],
[qryResultsCBO].[txtResult] FROM [qryResultsCBO];" I now get all three
of these in the drop down, but it will do for now. At least I am getting
the right value in there.

The problem that I have now is that I don't want the user to be able to
check the three heading above.  Before I got too far into this, I
actually had a fix: 

"If Len(cboResults) > 10 Then"  
   ''Me!cboResults = ""
   ''Me!cboResults.Dropdown
'End If

And this worked great...if you chose one of the headers, it just
blanked out and reopened the drop down. I used the number 10 because it
is the limit for this choice...I actually used it arbitrarily at first,
but it turned out to be exactly what I needed.  However, when it worked,
I had neglected to link it via Control Source. And, when I put it back
it it didn't work.  I am working on this, but how do I refer to a row,
in a combo box, for the "Len" function? I have used the following
with no avail:


'chkString = [Forms]![frmFEDSMain]![cboResults].[Column](0)
..................this gives a length of 42, which is this string

If Len(frmFEDSMain!cboResults.ItemsSelected) > 10 Then
........................nada





More information about the AccessD mailing list