Change One Field When Data Entered In Another (1 Viewer)

statsman

Active member
Local time
, 21:45
Joined
Aug 22, 2004
Messages
2,088
My Edit info form has several fields. The two of interest are:
Filestatus - text - open or closed
Dateclosed - date format
When the file is created, the filestatus field is set to "Open". What I would like to do is when a date is entered into the dateclosed field, automatically change the filestatus to "Closed".

Any suggestions?

Thanks in advance.
 

statsman

Active member
Local time
, 21:45
Joined
Aug 22, 2004
Messages
2,088
PS
I did try in the afterupdate of the dateclosed field

If [dateclosed] > 0 then
[status] = "CLOSED"
endif


didn't work
 

iangirven

Registered User.
Local time
Today, 02:45
Joined
Mar 22, 2002
Messages
71
try
if IsNull(dateclosed)=False then
status = "closed"
End If
 

pbaldy

Wino Moderator
Staff member
Local time
, 18:45
Joined
Aug 30, 2003
Messages
36,139
I would question whether you need the status field at all, if a record's status can be determined by the date field.
 

iangirven

Registered User.
Local time
Today, 02:45
Joined
Mar 22, 2002
Messages
71
status field

Paul,

Good point that I overlooked, even though I do it that way myself. However I think in this case there may be queries running that serach for records where the status is closed, regardless of any of the dates. If not the status field may be redundant and just taking up space in the table.

regards

ian
 

statsman

Active member
Local time
, 21:45
Joined
Aug 22, 2004
Messages
2,088
Guys
Following your suggestions I have given the status field a re-think.
You're right, it is redundant.
It's amazing the things you learn in this forum.
 

iangirven

Registered User.
Local time
Today, 02:45
Joined
Mar 22, 2002
Messages
71
help

Statsman,

Glad to be of help. I agree this forum is a very useful resource and I am always impressed with the knowledge of people here and the help they give.

regards
ian
 

Users who are viewing this thread

Top Bottom