T
Tanya Shepherd
I have two tables. One is member information and the
second contains Member Stay Information. On the second
table, I would love to make the primary key the Member ID
and Start Date. A member can have mulitple (stays) start
dates as long as the start dates for the member are not
duplicated. However, because of the way I need to set up
the form for user input this is not possible. The users
want to see the member info (member ID, name, etc) once
(main form) and all of the start date and associated info
in a continous form below (subform - linked by member
ID). So the primary key option is not working for me.
I've been trying to use data validation in the form but it
doesn't seem to work.
When I put in the following as the Validation Rule for the
Start Date field in the form, it accepts all data
including duplicates.
Not In (SELECT [Stay Data].[Stay Start]
FROM [Stay Data]
WHERE ((([StayData].[Mem #])=[Forms]![Member Stay Form]!
[Mem #])))
I know my problem is not the "IN" Statement because if I
type in the following, my validation works.
Not In (#01/01/2003#,#02/01/2003#,#03/01/2003#)
I think the problem is the way the SELECT statement is
returning the dates but I'm not sure. I know that field
validation rules cannot contain references to other fields
that is why I'm putting this validation on the control in
the form. Is it possible that MS ACCESS won't allow me to
reference the data element in the validation and considers
this a circular reference?
Any help would be greatly appreciated.
Tanya
second contains Member Stay Information. On the second
table, I would love to make the primary key the Member ID
and Start Date. A member can have mulitple (stays) start
dates as long as the start dates for the member are not
duplicated. However, because of the way I need to set up
the form for user input this is not possible. The users
want to see the member info (member ID, name, etc) once
(main form) and all of the start date and associated info
in a continous form below (subform - linked by member
ID). So the primary key option is not working for me.
I've been trying to use data validation in the form but it
doesn't seem to work.
When I put in the following as the Validation Rule for the
Start Date field in the form, it accepts all data
including duplicates.
Not In (SELECT [Stay Data].[Stay Start]
FROM [Stay Data]
WHERE ((([StayData].[Mem #])=[Forms]![Member Stay Form]!
[Mem #])))
I know my problem is not the "IN" Statement because if I
type in the following, my validation works.
Not In (#01/01/2003#,#02/01/2003#,#03/01/2003#)
I think the problem is the way the SELECT statement is
returning the dates but I'm not sure. I know that field
validation rules cannot contain references to other fields
that is why I'm putting this validation on the control in
the form. Is it possible that MS ACCESS won't allow me to
reference the data element in the validation and considers
this a circular reference?
Any help would be greatly appreciated.
Tanya