What I would like to do is when a particular product is searched for - I
want the form to disable certain sections of the form so data cannot be
entered. I want to disable a few text boxes & labels. The reason for this is
that some medicines are fridge items and additional details need to be
entered for this, but when it is not a fridge item I want certain controls to
be disabled so data cannot be entered. Additionally is it possible to get a
warning sign to say “this is a fridge line product”.
Yes, you can do this - for instance in the Current event of the Form
(which will fire when a new record is displayed, whether it's from a
search or from moving to a record with the navigation buttons). For
instance
Private Sub Form_Current()
If Me.Refrigerated = True Then
Me!txtThisControl.Enabled = False
Me!txtThatControl.Enabled = False
Me!lblThisLabel.Caption = "This is a fridge line product"
Me!lblThisLabel.Forecolor = vbRed
Else
Me!txtThisControl.Enabled = True
<and so on>
End If
End Sub
John W. Vinson[MVP]