Solved

Create Form Header/Footer In VBA

Posted on 2001-07-19
5
938 Views
Last Modified: 2008-03-10
From the answers I have received, I think this extra fact might be important. I am tring to do this from another database using the access.application object.

For other properties I am using:
set frm = objaccess.forms(doc.name)
frm.recordselectors = false

when I do frm.section(formfooter).visible = true it just runs the code without error but doesn't do the job.

I am writing some code to open a form in design view and do certain formating. One thing I have come stuck on is doing the equivelant of 'Show Header/Footer' and then adding a control to the footer. If I manually show it I can then control it using code but I can't get it to show from code. Any Suggestion??
0
Comment
Question by:regodab
  • 2
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
Nosterdamus earned 200 total points
Comment Utility
Hi regodab,

Use:

Forms!MyForm.Section(acHeader).Visible = True

Change MyForm to the real name of your form.

Hope this helps,

Nosterdamus
0
 
LVL 7

Expert Comment

by:Nosterdamus
Comment Utility
Sorry,

Forms!MyForm.Section(acHeader).Visible

Will do...

Nosterdamus
0
 
LVL 8

Expert Comment

by:DennisBorg
Comment Utility
regodab:

Issuing the following command should toggle the form's header/footer:

   DoCmd.RunCommand acCmdFormHdrFtr

-Dennis Borg
0
 

Author Comment

by:regodab
Comment Utility
This does work but not quite in my situation, I have reposted the question with more details.

Thanks
0
 
LVL 8

Expert Comment

by:DennisBorg
Comment Utility
regodab:

>This does work but not quite in my situation, I have
>reposted the question with more details.

What is "This"? More than one person had submitted a solution, so your reference to "this works but not quite in my situation" is quite ambigious.

It would be far better to submit a post explaining how "this" did not quite work for your situation so that we could submit solutions better suited for your situation.

Could you please at least provide a link to your "new" question?


-Dennis Borg
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now