How to undo a record which was created through a macro?

S

Sally

The form is opened with a macro to open it to a new
record with a autonumber. How can I undo this record if
the patient's last and first name has already existed in
the db? I have the lastname and firstname txtbox
arranged side by side and wrote a firstname_beforeupdate
event to cancel the event and undo the entering. It
seems that it only apply to the firsname but not the
lastname and the record still got created. Can someone
help me write the right coding? thanks.
 
S

Steve Schapel

Sally,

One option is you can attempt to save the record after entering the
first name and last name. If you are using a macro, this would be a
RunCommand/SaveRecord action. And then, put your macro to check the
name already exists, on the BeforeUpdate event of the Form itself (not
the controls), and thus your CancelEvent and Undo can also apply here.

However, are you sure this is what you want to do? It is possible for
two people to have the same name, so the entry may in fact be legitimate
even though a record with the same name already exists.
 
S

Sally

Thank you, Steve.

I agree with your comments. I have created a combox to
check with each entry's first and lastname before the
record is created and it works fine. I thought this
could be another easy approach. But, due to the design
structure that I chosed it seems that the record has been
saved(existed) once I hit the open new record button and
make the code to check the name so hard to write (for me).

I have another question, if you don't mind.

I am thinking migrate my Access/mdb to SQL, i have no
problem with the table design, but have no idea how to
start a dynamic web form from scratch. What is your
advise?

Thanks, Sally
 
S

Steve Schapel

Sally,

I personally do not have experience with SQL Server, or dynamic web
forms. I suggest you post your question as a separate thread. Maybe
one of these newsgroups would be more applicable:
microsoft.public.access.adp.sqlserver
microsoft.public.access.dataaccess.pages
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top