Validation rule with date and child table

ulieq

Registered User.
Local time
Today, 05:08
Joined
Dec 15, 2011
Messages
28
Date
Parent
LICENSE: L_ID, Duration (# of months), other stuff
Child
LICENSE_PERIOD, LP_ID, L_ID, Cost, Expire_Date

Issue:
I already have a double field index on LP_ID and Expire_date in the child so that a duplicate will not be posted but...
How to:
How to add an additional validation so that the Expire Date is not less than or more than the Previous Expire_Date +/- Duration from parent table.

Would this be to complicated to validate? Thanks guys!
 
Hi,

If you need to validate on a condition from a previous (or any other) record, you're best bet will probably be to check it on the form's (or control's) BeforeUpdate event. Table level validation is great for strict validation rules, but doesn't do such a good job with dynamic validation (unless you're using 2010 and implementing triggers).

hth
 
Hey,im sorry to turn this around but i have a simple question.Im currently working on a login form.ive got the code i want to validate the id,email adress and password of a user using DLookup.but the trouble is ,after it validates it adds the entered data into the table! so in the end I have 2 of the same records in the database.Is this a common problem?here is my code.Its pretty simple.
Private Sub cmd1_Click()

If (DLookup("Password", "table1", _
"[ID]=" & Me.txtid.Value)) > 0 Then

'Close logon form and open splash screen

DoCmd.Close acForm, "f1"
DoCmd.OpenForm "f2"

Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.Password.SetFocus
End If


End Sub
 
Hi newbee1,

I'm new to this board as well, and aren't familiar with their policies, but in general it's better to start a new thread asking questions rather than jumping into someone else's. It helps keep things from getting all mixed up.

Cheers,
 
live and learn :) in any case, maybe they aren't strict about it here, but as a general nettiquite thing is a good practice.

Cheers,
 

Users who are viewing this thread

Back
Top Bottom