How do i relate one field to another within a single table?

G

Guest

I have a table with a boolean field (yes/no tick box) called CAST. I also
have another field called DATECAST. When the tick box in CAST is un-checked
then the DATECAST box should be left blank, indicating the the particular
item has not been cast (we manufacture concrete items). However, when the
CAST tick box is checked i want the current date to automatically register in
the DATECAST field, thereby keeping a record of when the unit was cast.
This sound a simple operation (IF THIS THEN THAT) but I can't find any place
on the field properties box that will allow this sort of expression. I'd be
really grateful if someone could shed some light as it is my intention to use
this principle elsewhere in the application. - My fingers are crossed.
 
G

Guest

You can't do this sort of thing if you are entering data directly into your
table. You must use forms for this so that you can use code & macros & trap
certain events.
If your are using forms already (could not tell from the question) then you
can put this code in the after update event of the check box.

If [CAST] = True then
[DATECAST] = Date()
Else
[DATECAST] = ""
End if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top