Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Values- Help!

Status
Not open for further replies.

ianbar

Technical User
Jan 10, 2003
69
0
0
GB
Can someone point out where I am going wrong below? I am trying to change the value of one field based on another field having a any value.


Private Sub ClosedDate_Exit(Cancel As Integer)
If Me!ClosedDate.Value = Not Null Then
Me!CurrentlyWith.Value = "CLOSED"
ElseIf Me!ClosedDate.Value Is Null Then
Me!CurrentlyWith.Value = " "
End If
End Sub
 
Hmmm, I think I know what you are trying to achieve here.

Try this:

Private Sub CurrentlyWith_Event(Cancel As Integer)
If IsNull ([ClosedDate])Then
Me!CurrentlyWith = " "
Else
Me!CurrentlyWith = "CLOSED"
End If
End Sub

Thus when you enter/tab into the CurrentlyWith field, if there is no date entered in the ClosedDate field the currently with. field is set to " " else if there is a date the field is set to "Closed". Then later if you want you can add a date to an existing record and the CurrentlyWith field will be set to closed.

Is this what you are trying to achieve?

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top