auto populate on form

John thomas

Registered User.
Local time
Today, 12:22
Joined
Sep 4, 2012
Messages
206
Hi I have a form That takes quite a bit of filling in
At the botom there is a field that alows the user to document any Hazards with notes
If notes are entered here I would Like to auto populate a field at the top of the form with the Word Hazard In red .
Is this possible I am new to accessAnd need answers to be simple as poss
Many Thanks John
 
Create your Textbox and Format it as you want (probably Centered, Bold and Red with the Locked Property set to Yes) then use this code
Code:
Private Sub txtDocumentHazard_AfterUpdate()
 If Nz(Me.txtDocumentHazard, "") <> "" Then
  Me.txtHazardWarning = "Hazard!!!"
 Else
  Me.txtHazardWarning = Null
 End If
End Sub

Private Sub Form_Current()
 If Nz(Me.txtDocumentHazard, "") <> "" Then
  Me.txtHazardWarning = "Hazard!!!"
 Else
  Me.txtHazardWarning = Null
 End If
End Sub
You'll need to replace txtHazardWarning and txtDocumentHazard with the actual names of your Textboxes.

Linq ;0)>
 
Hi missing link
Thats Great I will try now
I am trying to learn code is it pos to show how this works
If it takes to long dont worry
Many thanks
 
Hi mising link How do I get this to run is it linked to an event on the text box
 

Users who are viewing this thread

Back
Top Bottom