Data Entry form

  • Thread starter Thread starter Loi
  • Start date Start date
L

Loi

Hi,
I created the form named DATA ENTRY for VIEWING and ENTER
NEW DATA. On the form, I inserted a button attached
macro "New Record".

Whenever, I click "New Record" button,It turns to empty
form so that I can enter new data. I think that it is very
convenice to view and enter data on the same form.
However, I would like to create another button named "Back
to Main" which only appears on ENTER NEW DATA screen, not
on VIEWING screen.

Loi
 
Please post your question in one group only.

You cause multiple people to spend time working on your question when you
post the same thing in many groups.
 
One strategy would be to use 2 (similar) forms. One the view/edit version -
with an "AddNew" button that will open form #2. The second form will be set
to DataEntry and have a command button to close it. Since form#1 is still
open ( as it is the only way to open form#2) form#1 will now display. You
could even make form#2 a pop-up and modal form so that users get to see it
on top of form#1 and must deal with it before returning to form#1.
-Ed
 
I created the form named DATA ENTRY for VIEWING and ENTER
NEW DATA. On the form, I inserted a button attached
macro "New Record".

Whenever, I click "New Record" button,It turns to empty
form so that I can enter new data. I think that it is very
convenice to view and enter data on the same form.
However, I would like to create another button named "Back
to Main" which only appears on ENTER NEW DATA screen, not
on VIEWING screen.
Loi

Loi, this is one of the reasons we try and get people to not use
Macros.

What you need is easily accomplished with a line of code but you need
to have the VBA code and not a macro to do it.

- Convert your macro to code (Tools->Macro->Convert form's macro to
VBA)
- in the Event Procedure for the Button's On Click which I think is
where your macro/code is, add the following line

Me![MyBackToMainButton_ControlName].visible = True

- in the On Exit Event Procedure Code make sure that you turn the
button back off again as you leave the form

Me![MyBackToMainButton_ControlName].visible = False

Now depending on how your form's built and what code is in there, this
might not be quite right and will need some tweaking that we can help
with ... but you need to do this forst. I would make a copy and mess
about with that as it allows you to be a little more adventurous and
experimental without you forgetting how to return it to how it was
before.


Cheers,
Brett
 
Back
Top