A
Alain Bourgeois
Dear all,
I have a form PatientsAdd (in add mode, only for adding new record)
based on a table, patients.
PK of patients is [ID Patient].
I have a zone named SIS. Althigh this zone is not a unique key, I would
like to warn user if a
duplicate [SIS] value is added in the table.
In the before update event of the zone, I execute the following macro:
Condition Action
[sis] is null
stopmacro
DLookup("[SIS]";"Patients";
"[SIS]=forms![PatientsAdd]![Sis] and
[ID Patient]<>forms![PatientsAdd]![ID Patient]") is NULL
stopmacro
MsgBox
"warning, duplicate".
This macro has always run ok in the application (running on 60 sites
with access versions '97, 2K, XP, 2K3).
But in access 2007, I can't edit the zone! If I enter zone, set
something in it, I can't exit the zone, the cursor keeps blocked in it.
I don't get a message box and it seems stopMacro invalidates the update.
(cursors stays in the zone and I get an error if I click on "save
record" icon). I only can make "Escape" and leave the zone empty.
PS the db is still in Access 2K format.
Regards,
Alain Bourgeois.
I have a form PatientsAdd (in add mode, only for adding new record)
based on a table, patients.
PK of patients is [ID Patient].
I have a zone named SIS. Althigh this zone is not a unique key, I would
like to warn user if a
duplicate [SIS] value is added in the table.
In the before update event of the zone, I execute the following macro:
Condition Action
[sis] is null
stopmacro
DLookup("[SIS]";"Patients";
"[SIS]=forms![PatientsAdd]![Sis] and
[ID Patient]<>forms![PatientsAdd]![ID Patient]") is NULL
stopmacro
MsgBox
"warning, duplicate".
This macro has always run ok in the application (running on 60 sites
with access versions '97, 2K, XP, 2K3).
But in access 2007, I can't edit the zone! If I enter zone, set
something in it, I can't exit the zone, the cursor keeps blocked in it.
I don't get a message box and it seems stopMacro invalidates the update.
(cursors stays in the zone and I get an error if I click on "save
record" icon). I only can make "Escape" and leave the zone empty.
PS the db is still in Access 2K format.
Regards,
Alain Bourgeois.