Visible TxtBox if......

  • Thread starter Thread starter Jomar Kjøsnes
  • Start date Start date
J

Jomar Kjøsnes

Hey.
I have an Main menu in my access program.
I want a message to pop up when a field in a query reach a value(eks >0 ).
The query name is qryMinimumslagerF and the field in it is called
Minimumslager.

I have a code like this:

Private Sub TxtVarsel_BeforeUpdate(Cancel As Integer)
If ([qryMinimumslagerF].[Minimunslager]) <> "" Then
Me.TxtVarsel Visible = True
Else
Me.TxtVarsel Visible = False
End If

Its in the Before update event in the text box on the main menu i want to
pop up.

I suggest I'v placed the code in wrong place, or is it any other more easy
way to do this.

Regards Jk
 
Jomar Kjøsnes said:
Hey.
I have an Main menu in my access program.
I want a message to pop up when a field in a query reach a value(eks >0 ).
The query name is qryMinimumslagerF and the field in it is called
Minimumslager.

I have a code like this:

Private Sub TxtVarsel_BeforeUpdate(Cancel As Integer)
If ([qryMinimumslagerF].[Minimunslager]) <> "" Then
Me.TxtVarsel Visible = True
Else
Me.TxtVarsel Visible = False
End If

Its in the Before update event in the text box on the main menu i want to
pop up.

I suggest I'v placed the code in wrong place, or is it any other more easy
way to do this.

Regards Jk

If TxtVarsel is invisible then it will never have a BeforeUpdate event fire.

I'm not sure, but I think you want to place the code behind the form's
OnCurrent event - this way the code will run as you move through records on
the form.

Ed Metcalfe.
 
Back
Top