Change acMode

  • Thread starter Thread starter mike_n_va
  • Start date Start date
M

mike_n_va

I have a form that I open (DoCmd.OpenForm) initially set
acFormReadOnly. I have a cmdButton "Update" and want to change mode of
the form to 'edit' until the user moves to the next record of previous
(changes the record pointer.

Just new to access and don't have much experience with the commands
and usage. thanks for the help.
 
On Tue, 6 Oct 2009 18:07:02 -0700 (PDT), mike_n_va

That's not the best way to do it. Rather open the form normally and in
Form_Open you can write:
Me.AllowEdits = False
and in your buttonclick, write:
Me.AllowEdits = True.

There are a few more AllowXxxx properties. Consider if you want to set
them as well.

-Tom.
Microsoft Access MVP
 
Thanks Tom -

I found this solution and combined it with another...
"...until the user moves to the next record ..."
Here I used the Form_Current() and a condition:
If Me.AllowEdits = True Then
Me.AllowEdits = False
...

This works well.
I would also like to dynamically change the qry based on the selection form
the MainMenu. I use the same form for three options, Project In-work,
Projects Unassigned and Completed Projects. Projects unassigned is where the
(boss) can initiate projects (at the business level) and hold them until a PM
and staff are available to develop. Once the PM is assigned, the Project is
marked "Active" and goes into 'In-work'. There the PM manages the data until
'complete.'
Each form has a slightly different menu option at the top of the (same)
form. Unassigned is the only place you can 'start' a new project. This
button is NOT on the 'In-work' Form, the form-data is the same for all three.
I like your idea of assigning the methods at Form_Open.
Original programmer used a lot of macros and I am transitioning to code.
Eventually want to implement ADO access to a remote MS Access data and allow
simultaneous access to the program with shared access and record locking on
the database.
I'm learning a lot and enjoy the new chanllenge, thanks Tom.
 
I think I just solved my own problem...

If I make the menus options of each selection (selected from the MainMenu)
the main_form and have the project_data_form a subform, ideally, I will only
have to maintain one instance of the form with the data fields on it... I
also have subforms to the projects_data_main_form, guess they will be
subsubforms? Anything to watch out for here??? This is kinda new to me...

thanks, mike
 
Back
Top