Access Button VBA programming

Julius Menzel 1 Reputation point
2021-12-09T07:42:11.333+00:00

I have the following problem, I have created an Access database and have a main input form with several subforms for different project classes.

This form will be processed by different people in the future and is therefore susceptible to unwanted changes to the data entered.

My question now is the following. How can I block the form when it is opened?
And how can I then unlock them with a botton in the form to make entries?
Then the form should be blocked again by clicking the button again.

Unfortunately, I have failed to program this so far, so if someone could help me, I would be very grateful!

Thank you for any help in advance!

Microsoft 365 and Office Access Development
Developer technologies Visual Basic for Applications
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tom van Stiphout 1,861 Reputation points MVP Volunteer Moderator
    2021-12-09T15:14:32.02+00:00

    You can have this one-liner in the button click event:
    Me.AllowEdits = Not Me.AllowEdits

    That will work for the parent form. I'm sure you can work it out if subforms need a similar line.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.