If someone can help me gray out one field if another field is filled in on the form. Example: If textbox containing Mass is filled in then gray out Volume and if Mass is not filled in then gray out Mass and allow to fill in Volume.
If Me.Mass = 0 And Me.Volume = 0 Then
Me.Volume.Enabled = True
Me.Mass.Enabled = True
Else If Me.Mass <> 0 And Me.Volume = 0 Then
Me.Volume.Enabled = False
Me.Mass.Enabled = True
Else If Me.Mass = 0 And Me.Volume <> 0 then
Me.Volume.Enabled = True
Me.Mass.Enabled = False
End If
This code checking for a Value of Zero, but a Control that 'is not filled in' isn't equal to Zero but rather is Null!...If textbox containing Mass is filled in then gray out Volume and if Mass is not filled in then gray out Mass and allow to fill in Volume.
If Nz(Me.Mass, "") = "" Then
Private Sub SizeLb_AfterUpdate()
If Nz(Me.SizeLb, 0) <> 0 Then
Me.SizeOz = Null
Me.Weight = (Me.SizeLb * Me.Packout)
End If
End Sub
Private Sub SizeOz_AfterUpdate()
If Nz(Me.SizeOz, 0) <> 0 Then
Me.SizeLb = Null
Me.Weight = (Me.SizeOz * Me.Packout) / 16
End If
End Sub
Private Sub Packout_AfterUpdate()
If Nz(Me.SizeLb, 0) <> 0 Then
Me.SizeOz = Null
Me.Weight = (Me.SizeLb * Me.Packout)
End If
If Nz(Me.SizeOz, 0) <> 0 Then
Me.SizeLb = Null
Me.Weight = (Me.SizeOz * Me.Packout) / 16
End If
End Sub
Private Sub Form_Current()
If Nz(Me.SizeLb, 0) <> 0 Then
Me.SizeOz = Null
Me.Weight = (Me.SizeLb * Me.Packout)
End If
If Nz(Me.SizeOz, 0) <> 0 Then
Me.SizeLb = Null
Me.Weight = (Me.SizeOz * Me.Packout) / 16
End If
End Sub