Are you sure you're getting all the months when you select 30? If 2 is the only one that isn't meant to appear in the dropbox then you may have simply not noticed it missing. That is all I can really think with that problem since your code seems fine.iphonerose said:I want to be able to limit the options in the Book From month drop down box based on what the user selects in the book from date drop down box. (i.e. if a user selects 30 in the date drop down box, I don?t want 2 (feb) to appear as an option in the month drop down box and similarly with 31 and relevant months).
At the minute if I select 31, the options in the month from box are right but if I select 30, I get all months. If any of ye have the time I?d appreciate some help with where I?m going wrong.
I think dropboxes have a function which clears the box of any current cells -- something like BF_month_bx.Items.Clear() for your code -- so try implementing that at the start of the procedure. VB certainly provides such a function for listboxes as I've just checked my old VB work for such a function, so I'd be surprised if they didn't provide the same for dropboxes.Also I was wondering if there is a way to clear the month box every time I select a new date? For example at the minute, if I select 31, I get the options: 1, 3, 5, 7, 8, 10, 12 and then if I change the selection to 14 for example and I then click the dropdown for month I have: 1, 3, 5, 7, 8, 10, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12.
I put it in where you said, when I fixed my other problem (the main problem) then the clear function worked too.Mortai Gravesend said:Curious, where did you have to put the line that clears things?iphonerose said:Got it working![]()