Dave,
Hmmm... You could put a macro on the After Update event of the Status
control on your form, with two SetValue actions, like this:
Condition: [Status]="open"
Action: SetValue
Item: [date opened]
Expression: Date()
Condition: [Status]="closed"
Action: SetValue
Item: [date closed]
Expression: Date()
However, I am bound to say that this would very liwould be regarded as
poor database design. You probably should not have a Status field at
all. Status of open/closed can be derived from existing data (i.e. the
dates), and as such should not really be stored independently in the
table, as it can always easily be returned via a query or expression,
whenever you need it for your purposes of form or report.
Therefore, to turn your question upside down, you can enter your date
opened and or date closed directly (hint: there is a built-in keyboard
shortcut for this... Ctrl+; or else you could set up a button to click
to enter the current date). And then instead of the Status being a
field in the table, put an unbound textbox on the form, with the Control
Source set like this:
=Switch([date closed] Is Not Null,"closed",[date opened] Is Not Null,"open")
Hope that makes sense. You said you're new to Access, so we might as
well get you off on the right foot.
Another question, I have a "status" field, which has the options of an open
or closed. I have to 2 columns (date opened and date closed)...is there a way
that when I select "open" in the status field, it puts in the date, and same
when i select close? I have been trying different things for a few hours now.