Set database form properties

  • Thread starter Thread starter Ian King
  • Start date Start date
I

Ian King

Using Access XP.

When I've finished writing a database, I manually go through all the forms
and manually set the Cycle property to 'Current Record' and the Allow Design
Changes to 'Design View Only'. This is really tedious with big programmes!

Is there a bit of code anyone could offer that could automate this?

Many thanks
Ian King
 
Public Sub SetCycleDesign()

Dim aob As AccessObject

For Each aob In CurrentProject.AllForms
DoCmd.OpenForm aob.Name, acDesign
Forms(aob.Name).Cycle = 1
Forms(aob.Name).AllowDesignChanges = False
DoCmd.Close acForm, aob.Name, acSaveYes
Next aob
MsgBox "Done!"

End Sub

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Brenan,
Many thanks for code.

The reason for setting these properties is that it prevents toolbars opening
when forms or subforms get the focus and prevents going to a new record when
tabbing from the last control on a form.

Mainly though it's because I'm not organised enough to do this when creating
a new form!

Regards
Ian King
 
Back
Top