Help with Lebans ComboCurrentRow

H

HilcrRWise

I am attempting to create a form that includes a comboBox and a TextBox
The TextBox is to be linked to the ComboBox so that when the mouse i
hovered over a specific row in the ComboBox that row value is displaye
in the TextBox. The closest code I have been able to find so far i
the Lebans ComboCurrentRow example, however this only displays the ro
number, is it possible to modify this code so that it displays th
value rather than the number
 
H

HilcrRWise

Forget the above query, I eventually managed to work it out for myself.
However I have come accross a different problem with the code.

If the number of rows in the combobox is less than the List Row
property of the combobox, the row number provided does not match u
with the currently selected row, you often get 2 or more row number
per each actual visible row
 
S

Stephen Lebans

I just checked and do not see that behaviour here on A97. If the number
of rows for the data is less than the ListRows property then the Drop
Down window automatically reduces in height to only show all available
rows.

I coded a workaround before I bothered to check.
' Allow for when the total number fo rows is LESS THAN the
' ListRows property.
If Me.Combo3.ListCount < Me.Combo3.ListRows Then
lRowHeight = lRowHeight \ Me.Combo3.ListCount
Else
lRowHeight = lRowHeight \ Me.Combo3.ListRows
End If

Which version of Access are you seeing this issue in?
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
H

HilcrRWise

Stephen I have just reread your post and believe you misunderstood th
problem.

The drop down window for the combo box does reduce in size from th
listrow value when there are less entries. The problem is that you
code does not seem to recognise this. The easiest way to show thi
problem is if you open the 'ComboCurrentRow' delete all but 4 of th
records in the customer table, and then try using the form. You shoul
see that for each actual row in the combobox the Current Row valu
listed will indicate 2 or 3 rows.

I have tried this in both Access 97 and 2002 with the same result.

I added the previous code addition you provided to the mousedown even
of the combo box with no effect, so either it doesn't work in thi
situation, or I put it in the wrong section of the code if this is th
case please let me know exactly where it should go.

Thank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top