Using CF 5 and Access for a member directory application...

When the application Administrator adds a new member record, Access
gives that record a unique number (auto-increment field). I then use a
query of the database to learn what that number is using
max(MemberID).  I then use whatever MemberID is returned to run
another query in order to  display the details of the just entered
record as a confirmation to Administrator.

All that occurs within one template and it all works fine. The problem
is if the Administrator hits refresh on their browser.  The browser
refreshes the exact same information to the Administrator BUT it also
re-inserts the exact same data with a new MemberID.

How do I stop that attempt to re-run the insert query when all that's
occurring is a browser refresh?

Taking this one step further, I know I can prevent this from occurring
by making a record field unique (such as email or username).  I can
then check to make sure a new record isn't being added which has the
same email or username of an existing record and, if it does, return
an error message.

However, that doesn't really solve the problem fully because when I do
that, the template still attempts to re-processes the record insertion
but this time returns the error message "That email address is already
taken".  That prevents entries of duplicate records, but the message
is confusing to the Administrator.

I'd simply like, on browser refresh, to have the data re-displayed
without the template attempting to re-insert the record.  Is my
problem simply that I have the record insert and record display code
in the same template?

How do others handle this situation?  Thanks in advance.

-------------
Regards,
Bob Haroche
O n P o i n t  S o l u t i o n s
www.OnPointSolutions.com
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to