Open new copy of current form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I have been using the following bit of code to open forms in my
database:

DoCmd.OpenForm "fCycComments", , , , acAdd (where 'fCycComments' is the name
of a specific form in the database).

For some of my forms, however, the data entry person might need to enter
multiple records using the form they are currently on. How can I adjust the
above code to: 1) save the record they have just entered, and 2) open a blank
form so they can enter a new record?

I'll need to put this code behind a Command Button on multiple forms, so I
was hoping for something a bit more 'generic' (instead of having to
specifically name the form I want to open), so I can just copy and paste this
Command Button onto whichever form I need to without having to tweak the code
each time to name a specific form.

Thanks.
 
hi pat,
i'm confused. if they save the record, the form is now
free to enter a new record. why do you have to open the
form a second time? did you leave something out?

the code you are using cannot be tweeked to do what you
want. you can run the code a second time but becasue the
from is already open, running the code when the form is
already open will seem to have no effect.

as for the 'generic' button part, access doesn't know what
form to open unless you tell it. otherwise you get error
messages about can't find this, can't find that meaning
that you HAVE to specifically name the form you want to
open. sorry.
-----Original Message-----
Hello, I have been using the following bit of code to open forms in my
database:

DoCmd.OpenForm "fCycComments", , , , acAdd
(where 'fCycComments' is the name
 
Back
Top