Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show/Hide Label

Status
Not open for further replies.

midiman69

Technical User
Apr 27, 2005
34
GB
I have a tab control form with a subform (qrybomsubform)
I wish to show a warning message on the main form if the field Currcosttotal on the subform = zero (not Null - zero)
I have the following - this hides the label but doesn't show it when I move to a record with a zero value.
Currcosttotal is formatted currency to 4 decimal places and contains either a value or zero.

Can any one help??

Private Sub Form_Current()

If Forms!frmprojectstabbed!qrybomsubform.Form!Currcosttotal.Value = 0 Then
Me.test.Visible = True
Else
Me.test.Visible = False
End If

End Sub
 
Try this
If IsNull(Forms!frmprojectstabbed!qrybomsubform.Form!Currcosttotal.Value) Then
 
Thanks Yummy - still only hides the label and doesn't show it when Zero value on subform

Private Sub Form_Current()
If IsNull(Forms!frmprojectstabbed!qrybomsubform.Form!Currcosttotal.Value) Then
Me.test.Visible = True
Else
Me.test.Visible = False
End If

Dave
 
Also change the event of Form_Current to Form_Load. Actually dave I can help you but not esure of solution,because i m also new in Access.You can check either your if condition is rigt by replacing Me.test.Visible = True with MsgBox("True/False").
Also Debug it to check the value of Currcottoal.ok
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top