Avatar of SteveL13
SteveL13Flag for United States of America

asked on 

How open a form with all controls locked?

I have a form that I have opening as read only but it appears that some calculated fields aren't calculating in this mode.  So I want the form to open with all controls locked.  How can this be done?

-Steve
Microsoft Access

Avatar of undefined
Last Comment
mbizup
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of mbizup
mbizup
Flag of Kazakhstan image

On error resume next is generally not advisable as good error handling, but it will do the trick for this limited function.
Avatar of SteveL13
SteveL13
Flag of United States of America image

ASKER

Actually I'm opening the form from a hyperlink control on another form.  Where do I put the code:

Dim CTL as control
On error resume next
 For each CTL in me.controls
       CTL.locked = true
  Next

Its like the 2nd form has to check to see if the 1st form with the hyperlink is open and if so, do the code you wrote, right?
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Try it In the open event of the form you are opening
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo