Problem with mouse wheel

  • Follow


Hi I have a form and with mouse wheel record change and go to the next. That 
is ok I want to do that but I check a value of a field call System and I want 
if me.system.value <> "specific system" then 
   me.station.visible = false
else
   me.station.visible = true
end if

Unfortunately this part of  IF statement does not work correct. From the 
debuging I made I realized that me.system.value has the value of the previous 
record before the mouse wheel !!! How can I fixed that ????

Thank you in advance
0
Reply Utf 3/23/2010 7:41:01 AM


"Koulla" <Koulla@discussions.microsoft.com> 写入消息 
news:6C55E95D-E8F0-4E22-B27C-30E8ED988EAE@microsoft.com...
> Hi I have a form and with mouse wheel record change and go to the next. 
> That
> is ok I want to do that but I check a value of a field call System and I 
> want
> if me.system.value <> "specific system" then
>   me.station.visible = false
> else
>   me.station.visible = true
> end if
>
> Unfortunately this part of  IF statement does not work correct. From the
> debuging I made I realized that me.system.value has the value of the 
> previous
> record before the mouse wheel !!! How can I fixed that ????
>
> Thank you in advance 

0
Reply 136899587 3/23/2010 12:15:38 PM


hi Koulla,

On 23.03.2010 08:41, Koulla wrote:
> Hi I have a form and with mouse wheel record change and go to the next. That
> is ok I want to do that but I check a value of a field call System and I want
> if me.system.value<>  "specific system" then
>     me.station.visible = false
> else
>     me.station.visible = true
> end if
>
> Unfortunately this part of  IF statement does not work correct. From the
> debuging I made I realized that me.system.value has the value of the previous
> record before the mouse wheel !!! How can I fixed that ????
Which event is involved here? Post the complete method, please.

mfG
--> stefan <--
0
Reply Stefan 3/23/2010 12:21:38 PM

Here is the complete procedure

Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
if me.system.value<>  "specific system" then
    me.station.visible = false
else
    me.station.visible = true
end if
End sub


"Stefan Hoffmann" wrote:

> hi Koulla,
> 
> On 23.03.2010 08:41, Koulla wrote:
> > Hi I have a form and with mouse wheel record change and go to the next. That
> > is ok I want to do that but I check a value of a field call System and I want
> > if me.system.value<>  "specific system" then
> >     me.station.visible = false
> > else
> >     me.station.visible = true
> > end if
> >
> > Unfortunately this part of  IF statement does not work correct. From the
> > debuging I made I realized that me.system.value has the value of the previous
> > record before the mouse wheel !!! How can I fixed that ????
> Which event is involved here? Post the complete method, please.
> 
> mfG
> --> stefan <--
> .
> 
0
Reply Utf 3/24/2010 6:07:01 AM

hi Koulla,

On 24.03.2010 07:07, Koulla wrote:
> Here is the complete procedure
>
> Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
> if me.system.value<>   "specific system" then
>      me.station.visible = false
> else
>      me.station.visible = true
> end if
> End sub
This kind of code should be placed in the On Current event:

Private Sub Form_Current()

    txtStation.Visible = (Me![System] <> "Specific System")

End Sub

btw, you should rename your controls when they are referenced in code to 
distinguish between them and fields. Me![System] is accessing the field 
value.


mfG
--> stefan <--
0
Reply Stefan 3/24/2010 8:52:24 AM

4 Replies
187 Views

(page loaded in 0.114 seconds)

Similiar Articles:
















7/20/2012 4:52:51 AM


Reply: