Problem with mouse wheel

K

Koulla

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
 
G

Guest

Koulla said:
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
 
S

Stefan Hoffmann

hi Koulla,

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 <--
 
K

Koulla

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
 
S

Stefan Hoffmann

hi Koulla,

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 <--
 

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

Similar Threads


Top