One form two uses

  • Thread starter Thread starter Scott B
  • Start date Start date
S

Scott B

Greetings,

I need a from to enter new records only. No previous records show. I also
need a form to edit old records. I have users that cannot grasp the "do not
change old records" idea. So I make it hard toget to them. Right now I
have 2 identical forms one with Data Entry set to No and one set to Yes.

Is there a way to use one form and have Data Entry reset depending on which
command button is selected? One button would open it in Data Entry Yes and
one in Data Entry No.
 
Scott said:
Greetings,

I need a from to enter new records only. No previous records show.
I also need a form to edit old records. I have users that cannot
grasp the "do not change old records" idea. So I make it hard toget
to them. Right now I have 2 identical forms one with Data Entry set
to No and one set to Yes.

Is there a way to use one form and have Data Entry reset depending on
which command button is selected? One button would open it in Data
Entry Yes and one in Data Entry No.

On one button...
DoCmd.OpenForm "FormName",,,,acFormAdd

On the other...
DoCmd.OpenForm "FormName",,,,acFormEdit
 
Rick,

Seems to easy to be true. I was trying to find a hard way to do it. Many
thanks, it works great.

Scott B
 
Scott said:
Rick,

Seems to easy to be true. I was trying to find a hard way to do it.
Many thanks, it works great.

Be aware also that a form that is opened in DataEntry mode for new record
insertions simply has a special filter applied. If you apply a different
filter or "remove all filters" from the menu bar then you will still see
existing records.
 
Scott, I use the same identical code with 2 command buttons. It works great.
Only I also have a combobox on the form that allows the user to select the
correct record to edit when in edit mode. I added the line

Forms!frm_clientinformation.Combo63.Visible = False

to the code that opens the form in add mode and the line

Forms!frm_clientinformation.Combo63.Visible = True

to the code that opens it in edit mode. Thus the combobox is visible only
when the form is opened in edit mode.
 
Back
Top