Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Here's a Challenge

Status
Not open for further replies.

sjpistolesi

Programmer
Jun 6, 2002
71
US
ACCESS2000:

Number of items in a control box will vary when gathered by a query.

Would like to resize the control list box to shrink if just one or two items and grow if the number of items in the list are equal to 6 or greater to display the first 6.

Silly, I know when a user can scroll ... just trying to ease things a bit for the user in a friendly way. And, yes, I've discussed drop-down list selection ... but, ... (you know how that goes when the user prefers otherwise).

Sandy
 
I expect that you have a recordsource so you know when you have 2 or more records.
Try this:

MyRe.movelast
I=MyRe.Recordcount
if I>6 then I=6

Do while I>0
me!YrListbox.height=me!YrListbox.height+0501 'standard fld height apx
I=I-1
loop
Herman
 
This works okay, you may have to adjust the 250 depending.

lstItems.Height = lstItems.ListCount * 250

There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top