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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Before Update form code delima.. 1

Status
Not open for further replies.

realstandman

IS-IT--Management
Oct 29, 2003
87
US
I am trying to validate some fields based on other fields in a form. I have two fields that if they are > o then at least one of three other fields needs to have data. This is where I am now. The three fields are date fields and I am using access 2003 and access 2000 as my default.

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.txtHCFA Or Me.txtUB92 > 0 Then

'This is where I need to check to see if me.txtOldestDate or me.txtOldestDatePTP
'or me.txt214 has data. I only need at least on of these three to have data.


Else
MsgBox ("You must enter in an Oldest date")
End If
Me.txtOldestDate.SetFocus

Cancel = 1
Exit Sub

Any help is greatly appriciated. Thanks Stan

Don't think and the solution will come.
 
Code:
If NOT (IsDate(me.txtOldestDate) OR _
        IsDate(me.txtOldestDatePTP) OR _
        IsDate(me.txt214)) Then

   MsgBox ("You must enter in an Oldest date")
   Me.txtOldestDate.SetFocus
   Cancel = True
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top