Check Boxes

C

cpm

I am trying to track out magazines that I send out for my job to clients. I
have a field yes/no for sent, I want to record the date when i click "sent"
is it possible to do that or do i have to type in the date in a separate
field?
 
J

John W. Vinson

I am trying to track out magazines that I send out for my job to clients. I
have a field yes/no for sent, I want to record the date when i click "sent"
is it possible to do that or do i have to type in the date in a separate
field?

Where is this date stored? I'd suggest having a table to store the transaction
of sending a magazine, with fields for the clientID, the magazineID, and a
date field defaulting to Date(); it's not clear from your post which table has
this checkbox. If you want to record the date you do of course need a field in
which to record it, but the date can be filled in automatically. What's your
table structure, and what is this checkbox bound to?

John W. Vinson [MVP]
 
C

cpm

i have a table for media plans, which includes the check box sent yes/no and
another field for sent, that i enter the date manually. the publications are
in a separate table. I have no idea how to bind or what bound is. Please
Help!
 
J

John W. Vinson

i have a table for media plans, which includes the check box sent yes/no and
another field for sent, that i enter the date manually. the publications are
in a separate table. I have no idea how to bind or what bound is. Please
Help!

So each plan is sent to one, and only one, address? How are the tables for
Publications, Customers, and Media Plans related?

"Bound" means that there is a Form control with its control source set to the
name of the field in the table or query. An "unbound" control either has no
control source at all (sometimes useful on a Form if you want to type
something into it that doesn't get stored anywhere, such as a query
criterion); or some expression.

If you are entering the information directly into Tables - you're out of luck.
Tables aren't designed for data entry, and have very few useful events or
properties. If you use a Form you can put Macros or - better - VBA code in
form Events, such as the AfterUpdate event of a checkbox. Let's say you have a
checkbox on your form named chkSent, with its control source set to your
yes/no Sent field; and a textbox txtSentDate, bound to the field named
DateSent. You could view the properties of the Form; select chkSent; choose
the "Events" tab; and click the ... icon by the "After update" event. A VBA
editor window will open (you may need to choose Code Builder); you can then
edit the two lines that Access provides for free:

Private Sub chkSent_AfterUpdate()
If Me.chkSent Then
Me.txtSentDate = Date
End If
End Sub

This code looks to see if chkSent has been checked (and is therefore True, so
the If statement will execute the code between it and the End If); if it is,
it will set the txtSentDate textbox to today's date.

John W. Vinson [MVP]
 
C

cpm

i have been entering data directly into the table. Can i still use a form to
enter the data instead?
 
J

John W. Vinson

i have been entering data directly into the table. Can i still use a form to
enter the data instead?

Absolutely, and I'd really strongly recommend that you do so.

John W. Vinson [MVP]
 
Top