List box Click Event

garyd1234

Board Regular
Joined
Apr 17, 2003
Messages
103
Hi,
I have a form with several list boxes on it. Down the side of the list box are dates. My intent is to have a person click across from the date they wish and there is code on the on click event of the list box that takes them to a form. Well (Access 2000) sometimes when they click in the list box the line where they click just turns black and won't do the onclick code. They have to click somewhere else on the list box to get the form, close it, then click the date they want. Sometimes after 2 or 3 clicks it gives the MS.ACCESS has generated errors and will shut down message. What's up with that? Thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Not sure if you've worked through this yet, but I may have set up something similar. I made my list box a combo box instead, then defined the values (in your case dates) I wanted my users to select from. I then created an OnChange event in Access to procede off the selection. This should work unless the dates in your combo box are constantly changing...

Where "cmbCombo" is your combo box, and "Date1" and "Date2" are your como box's rowsource:


Private Sub cmbCombo_OnChange()

If me.cmbCombo.Value = "Date1" Then
Call WhateverYouWant
ElseIf me.cmbCombo.Value = "Date"2 Then
Call WhateverYouWant2
End If

End Sub
 
Upvote 0
Sounds like you may have a corrupt db, try running the repair utility

Peter
 
Upvote 0

Forum statistics

Threads
1,221,657
Messages
6,161,084
Members
451,684
Latest member
smllchng5

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top