Combox filter then lock record

scottappleford

Registered User.
Local time
Today, 19:40
Joined
Dec 10, 2002
Messages
134
Hi

I have a combo box to select a record on a form.

I would like then record to lock once it is selected via the combox box and the combo box to clear.

If a records is slected again from the combo box it will then show the new record and lock it again.

The problem is users are sometimes using the mouse button to scroll and moving to a different records by accident.

Thanks
 
You could avoid this problem by opening the record in a new form. That way your users cannot accidentally scroll to another record, provided that the recordsource of your new form is a query that results in only one record, namely the one that is selected in the combo box.

You can design your query like this by adding the combo-box in your query criteria.

If you do not know how to do this, upload your database, or part of it, and I'll show you.

Greetz,

Seth
 
db attached

Please find attached sample DB.

If you go to frmlperiod.

This is where i would like to be able to select from the combo box then lock the record and clear the combo ready for use again.

thinking ahead the combox is going to get populated quite quickly and a cascading combox box would be even better i.e. slect project, which then gives the date option?

Many Thanks
 

Attachments

Hello

I too have the problem of mouse wheel scrolling. How to disable that in a form?
 
answer below

The answer to disabling the scrolling of the mouse:

Import the module 'modMouseHook' from the attached sample db.

Add a copy of the 'MouseHook.dll' to the same folder as your db or to your windows dll library.

Add the attached to the form you want to stop the mouse scrolling on

Private Sub Form_Load()

' Turn the MouseWheel Off
Dim blRet As Boolean
' Call our MouseHook function in the MouseHook dll.
' Please not the Optional GlobalHook BOOLEAN parameter
' Several developers asked for the MouseHook to be able to work with
' multiple instances of Access. In order to accomodate this request I
' have modified the function to allow the caller to
' specify a thread specific(this current instance of Access only) or
' a global(all applications) MouseWheel Hook.
' Only use the GlobalHook if you will be running multiple instances of Access!
blRet = MouseWheelOFF(False)
End Sub

regards
 

Attachments

scottappleford said:
Hi

I have a combo box to select a record on a form.

I would like then record to lock once it is selected via the combox box and the combo box to clear.

If a records is slected again from the combo box it will then show the new record and lock it again.

The problem is users are sometimes using the mouse button to scroll and moving to a different records by accident.

Thanks
Your problem could have easily been resolved if you moved the focus "off" of the combo box in the AfterUpdate event of the comb box.
Code:
Me.AnotherTextBox.SetFocus

The users should be allowed to scroll through the records if the current record is not "dirty" [modified]. I avoid that problem using the method I demonstrate with my A better mouse trap? sample.
 
Hi

My problem was not with the combox box it was with the actual record as the combo box was a qucik search in the header of the form. as soon as users put the focus on the main form they could scroll the records and it was causing problems.

I like your sample - thanks

The sample i used above - stops the scroll altogether on that form and users do not have to press any buttons, so it is down to preference. The only thing with the sample i posted is the DLL and i do not know how to add that to windows rather than have it in the same folder?

Thanks for the feedback - and the duplicate has been deleted.
 

Users who are viewing this thread

Back
Top Bottom