Question Access Yes / no trigger

dsthome

Registered User.
Local time
Today, 18:10
Joined
Jan 21, 2011
Messages
24
:confused:

Hi new to this don't know if this is in the correct section.

I have set up a database and have a couple of yes/no fields. Is there anyway I can get a field which will automatically put the date in when the yes/no box is ticked? I have been looking at this for ages now without success

Thanks

Dsthome
 
In the After Update event of the control the field is linked to, put this:
Code:
if Me.TickBoxName = Yes Then
    Me.TextboxName = Date()
else
    Me.TextboxName = Null
end if
 
Hi Thanks for that I must be doing something wrong though, here is what I am putting in the after update section. However; when I tick the box the date doesn't appear, but does when I untick the record. Any ideas?

Private Sub Cut_AfterUpdate()
If Me.Cut = Yes Then
Me.cutdate = Date
Else
Me.cutdate = Null
End If
End Sub
 
Can you rename the Cut checkbox to chkCut, click the elipsis button in the After Update event again and redo the code.
 
Hi sorry I may be doing something very wrong here, still getting same result as previous.

Private Sub chkCut_AfterUpdate()
If Me.chkCut = Yes Then
Me.cutdate = Date
Else
Me.cutdate = Null
End If
End Sub
 
Hi

This is very much a work in progress report to track production. I am trying to get the basics correct before refining the database.

If you look into forms, basically we have 4 areas Saw 1, Saw 2, Saw 3 and Misc. I am trying to get the date to fill in when the tick box is changed, but it will only do so when tick removed. I am relativley inexpecrienced at Aceess as I am used to Approach, and finding a few things a bit difficult.

your help is much appreciated.

Kind Regards

Dave :)
 

Attachments

Users who are viewing this thread

Back
Top Bottom