Form_Current() Event

D

Dennis Powell

I have a form with code in the Form_Current() event. When I open the form
I'm using where condition that only returns one record like this:

doCmd.OpenForm "formname", , ,"[ID] = Forms![formwithlistbox]![lstID]"

When users use the Scroll Wheel on the mouse I get 'Error Number 3021 No
current Record'. Obviously the wheel is forcing the form to try to move to
the next record; but there is none. How can I disable the wheel on the mouse
(or trap it) so the form doesn't try to move from that record? If I trap
the error I can keep the user from having to deal with the error message;
but, It still moves off the current record and clears all of the controls.
I'm just trying to avoid having panicked users calling me saying that the
changes they just made are gone.

Any Ideas?

Thanks in advance.
Dennis
 
D

Dennis Powell

Thanks so much....worked like a champ. I usually program in C#, VB.Net and
SQL 2000 and have really only used Access as a back-end for VB. I'm doing a
side job for my wife's work in Access. I tried talking them into letting me
do it in VB; but, their Corporate HQ wouldn't approve it. They can't
install any software on their machines so her boss found a way around it by
just putting an Access .mdb file out on the server. So unfortunately, if
Me.Phone.Connected = False then that means Me.EverGonnaHaveSexAgain.Chances
= 0 ;-)


Klatuu said:
I forgot one item. Dealing with panic user calls:

Me.Phone.Connected = False

:)

Dennis Powell said:
I have a form with code in the Form_Current() event. When I open the
form
I'm using where condition that only returns one record like this:

doCmd.OpenForm "formname", , ,"[ID] = Forms![formwithlistbox]![lstID]"

When users use the Scroll Wheel on the mouse I get 'Error Number 3021 No
current Record'. Obviously the wheel is forcing the form to try to move
to
the next record; but there is none. How can I disable the wheel on the
mouse
(or trap it) so the form doesn't try to move from that record? If I trap
the error I can keep the user from having to deal with the error message;
but, It still moves off the current record and clears all of the
controls.
I'm just trying to avoid having panicked users calling me saying that the
changes they just made are gone.

Any Ideas?

Thanks in advance.
Dennis
 
G

Guest

I think that needs to go in the BeforeActStupid event :)

Dennis Powell said:
Thanks so much....worked like a champ. I usually program in C#, VB.Net and
SQL 2000 and have really only used Access as a back-end for VB. I'm doing a
side job for my wife's work in Access. I tried talking them into letting me
do it in VB; but, their Corporate HQ wouldn't approve it. They can't
install any software on their machines so her boss found a way around it by
just putting an Access .mdb file out on the server. So unfortunately, if
Me.Phone.Connected = False then that means Me.EverGonnaHaveSexAgain.Chances
= 0 ;-)


Klatuu said:
I forgot one item. Dealing with panic user calls:

Me.Phone.Connected = False

:)

Dennis Powell said:
I have a form with code in the Form_Current() event. When I open the
form
I'm using where condition that only returns one record like this:

doCmd.OpenForm "formname", , ,"[ID] = Forms![formwithlistbox]![lstID]"

When users use the Scroll Wheel on the mouse I get 'Error Number 3021 No
current Record'. Obviously the wheel is forcing the form to try to move
to
the next record; but there is none. How can I disable the wheel on the
mouse
(or trap it) so the form doesn't try to move from that record? If I trap
the error I can keep the user from having to deal with the error message;
but, It still moves off the current record and clears all of the
controls.
I'm just trying to avoid having panicked users calling me saying that the
changes they just made are gone.

Any Ideas?

Thanks in advance.
Dennis
 

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