Validating a date from another date in another table

m9jiihmr@gmail.com

New member
Local time
Tomorrow, 02:42
Joined
Jun 11, 2013
Messages
13
Hello All

Greetings !!

I have one ms access database which has two tables. One table name is Baseline. Second Table name is Followup. Both table has unique key named pid. Both table has one to one relationship set in database.

In the baseline table, there is a date field named dor. In the follow up table, there is a date field named dof.
What i want is, when dof is entered in table followup, each time, it should check , dof should always ahead of dor entered in Baseline table.

What code i use.
Where do i write.

I tried with Dlookup but did not work.
I am attached database also.

Many thanks
Regards
 

Attachments

Both table has one to one relationship set in database.
Not in the db that you posted it doesn't. It is defined, probably correctly, as a one to many.
You would usually use the "one" table as the record source of a "main" form and use the "many" table as the record source of a subform within the main form.
You would use the Before Update event of the subform to validate the record (in this case the date field).
Post back if you need more help
 
Not in the db that you posted it doesn't. It is defined, probably correctly, as a one to many.
You would usually use the "one" table as the record source of a "main" form and use the "many" table as the record source of a subform within the main form.
You would use the Before Update event of the subform to validate the record (in this case the date field).
Post back if you need more help

Thank you for response Sir.
Yes, you are correct, it is one to many relationship.

I dont want to check things in sub forms. I want to check things while entering in separate forms or in table. Like we do record validation. The moment, we leave the record, alert comes.

Or if it will be on forms. i want to do it on separate forms and not the subforms..
So when date is entered in follow up form, it checks date available in baseline table's date field.

dor in Baseline table.
followupdate in Followup table.

Regards
 
check the Change Data Macro on design view of table followup.
 

Attachments

check the Change Data Macro on design view of table followup.
Thank you for your reply.

I am not able to open it.
I was using office 2007. Looks like you used some other version and saved.
If you can save it in lower version and send me back, would be great.

Thanks
 

Users who are viewing this thread

Back
Top Bottom