Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

easy edit forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
susan - 14 Feb 2008 08:45 GMT
Hi.

Is there a possibility in Access 2003 to easily edit a form? In Visual Basic
you can even use a texteditor to edit the forms and modify properties of
objects. This is far more faster and easier than in Access.

Thanks
Allen Browne - 14 Feb 2008 09:02 GMT
Access is quite different from pure VB, in that the forms exist within the
database (MDB) file, not as separate text files on the drive.

The closest approach to what you ask for might be to export the form as a
text file, using
   SaveAsText acForm, "Form1", "C:\MyFolder\Form1.txt"
Then try editing the form, delete it from the database, compact, and ask
Access to import it again:
   LoadFromText acForm, "Form1", "C:\MyFolder\Form1.txt"
(You may need to experiment with this: it is undocumented, and version
sensitive.)

Some alternative approaches:
a) Select several objects at once in design view, and change the Properties
for them all at once.

b) Change the properties of the objects in the Toolbox. This sets the
default properties when you create new objects on this form.

c) Set up your MDB so that new forms get the properties you want. See:
   Default forms, reports and databases
at:
   http://allenbrowne.com/ser-43.html
(This one is *really* good in Access 2007, where new databases automatically
get and use the default forms you set up.)

d) Programmatically manipulate the objects on the form.
This kind of thing:

Function ShowControls(strForm As String)
   Dim frm As Form
   Dim ctl As Control

   DoCmd.OpenForm strForm
   Set frm = Forms(strForm)

   For Each ctl In frm.Controls
       Debug.Print ctl.Name, ctl.ControlType
   Next

   DoCmd.Close acForm, strForm
End Function

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Is there a possibility in Access 2003 to easily edit a form? In Visual
> Basic
> you can even use a texteditor to edit the forms and modify properties of
> objects. This is far more faster and easier than in Access.
>
> Thanks
Albert D. Kallal - 14 Feb 2008 09:10 GMT
For the most part, no you can not.

And, for the most part editing the actual meta text of a form will not help
you a lot anyway.

You can use the un-documented saveastext (and loadFromText) feature to
export a form into a meta text file that represents the form.

(from the debug window type in saveastext (you should get inti-sense
popup)).

You can thus send the object (form, report etc) out to a text file. You can
then edit that text file, save it, and then use the loadfrom text.

This process would be clumsy in practice, and thus this idea is not really
what you looking for, nor is it considered an approach that any developer
would use as a normal course of action.

So you *can* gain access to the text file(s) that represent things like
forms etc, but in actual practice, it not practical to edit forms this way.

For 99% of form editing tasks, you should find the form designer adequate
anyway...

Signature

Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com

Larry Linson - 15 Feb 2008 03:02 GMT
> Is there a possibility in Access 2003 to easily edit a form?

Yes, you can very easily edit an Access Form in Design View.

> In Visual Basic you can even use a texteditor to edit the
> forms and modify properties of objects. This is far more
> faster and easier than in Access.

Tell ya' what... if have an application suitable for Access (database,
individual user, multiuser Access/Jet in a LAN environment, or client
application to a server database in a LAN or WAN environment) and you
arrange a face-off between an accomplished Access developer and an
accomplished VB developer, the Access developer will win, hands-down, every
time. That was the case in the world of "classic VB" (V6 or earlier) and
it's still so in the world of DotNet.

Your view that using a text editor in VB is so much easier may be related to
the fact that VB.NET is much more code-intensive than Access.

Larry Linson
Microsoft Office Access MVP
(and user of VB from V1 through V6)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.