Tony:
I have entered the name changes and the code to reflect the changes. The
check
box field is now Last _Used, the date filed is now Date_Used. As a rookie I
ahve entered the code as follows. This is the date that was within the code
for the particular form. Unfortunately, it doesn't change the date at all.
I assume I've made an error somewhere. Any help would be great.
Option Compare Database
Private Used_for_AfterUpdate() 'After update event for the checkbox
If Me.[Used_for] = -1 Then
Me.[Date_Used] = Date
Else: Me.[Date_Used] = ""
'Me.[Question Field] = 'umm not sure what you mean by reset Question
'Field or what you question control name is.'
End If
End Sub
Private Sub Form_Load()
End Sub
Rudy
TonyT said:
Correct on the code being vba thru code builder.
Not quite sure what you are actually wanting to acheive here, but checkboxes
can be selected and unselected as many times as you like, the code I gave you
will *fire* every time the check box value is changed ie checked or unchecked.
Perhaps it would be easier if you try and do what you can then post another
question if it doesn't as you hoped, it's alot easier for us to work with
actual code to help you.
good luck,
TonyT..
:
Tony:
Thanks for the idea. I assume this is to be inout using the code builder
within the form. The names will be changed. The idea would include the
check box being unseleted and once unselected would now become avail to be
re-selected with the new date. Ie the question could be re-used and a new
Last Used date applied.
Rudy
:
Try something like;
Private Select_AfterUpdate() 'After update event for the checkbox
If Me.[Select] = -1 Then
Me.[LastUsed] = date()
Else: Me.[LastUsed] = ""
Me.[Question Field] = 'umm not sure what you mean by reset Question
Field or what you question control name is.
End If
End Sub
You should seriously think about changing your field names - Select is a
reserved word, and spaces in control names is also asking for trouble - try
using _ instead.
TonyT..
:
I have a form I have created using a query (Access 2000) using all the fields
from the query in the form. This form is being used to create exam questions
from a database. The form name is "All Questions" the check box is
designated "Select". I would like to use the select check box. so that when
selected the current date is selected and place in the date field. The date
field is designated " "Last Used". I would also like the form to reset the
question once the check box has been "unselected" Can this be done? If so,
how? ANy help would be great. Someone at work suggested something along the
line of:
=Forms![All Questions]![Select] Date()