By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,592 Members | 2,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,592 IT Pros & Developers. It's quick & easy.

Date field

P: 3
I have been gone from working on databases for about 10 years, and have forgotten a lot of what used to come naturally to me.

I have to learn some of the simple things again-- and my usual sources on the internet are no longer available

I have a simple form that has date fields. If the "completed" date field has an entry made into it---"status" has to change to "C"

if the "completed" date field is null, then "status will be "A"

but If "cancelled" box is checked, then "status" will be "CNC"

Thank you for being patient with me

Joy
Nov 5 '06 #1
Share this Question
Share on Google+
2 Replies


P: 3
Sorry

I didn't include the simple code I put in

Private Sub Form_Current()
If IsNull(Me.Completed) Then
Status = "A"
Else
Status = "C"
End If
End Sub

This changes the "Status" to "C" when the
"Completed" date field has an entry
and will be "A" as long as the completed date field is null

But I need to change the field to "CNC" when the project has been cancelled
Nov 5 '06 #2

P: 3
OK
maybe I answered my own question

Private Sub Form_Current()
If (Me.Cancelled) = True Then
Status = "CNC"
ElseIf IsNull(Me.Completed) Then
Status = "A"
Else
Status = "C"
End If
End Sub


I have been away from DBs for a long time. I knew it was just simple code, but I couldn't remember it
Nov 5 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.