accde - Report design

Hi,

I have some VBA that modifies a report's design.


However, the code throws an exception on this line:

DoCmd.OpenReport rpt_name, acViewDesign


I understand the reason why, so here's my question:

Q) How can my VBA code modify a report in an accde file?


Thanks
0
Utf
1/21/2010 6:26:01 AM
access 16762 articles. 3 followers. Follow

6 Replies
1465 Views

Similar Articles

[PageSpeed] 45

On Wed, 20 Jan 2010 22:26:01 -0800, Andy <Andy@discussions.microsoft.com>
wrote:

>Q) How can my VBA code modify a report in an accde file?

It can't. You must use an accdb.
-- 

             John W. Vinson [MVP]
0
John
1/21/2010 6:46:47 AM
Hello,
I have the same problem... and I create several reports...


"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> a �crit dans le 
message de news: 72ufl5tb2lvc3jffcgfqubr4c1ibbi0m4o@4ax.com...
> On Wed, 20 Jan 2010 22:26:01 -0800, Andy <Andy@discussions.microsoft.com>
> wrote:
>
>>Q) How can my VBA code modify a report in an accde file?
>
> It can't. You must use an accdb.
> -- 
>
>             John W. Vinson [MVP] 


0
jero
1/21/2010 10:48:19 AM
Andy wrote:

> Hi,
> 
> I have some VBA that modifies a report's design.
> 
> 
> However, the code throws an exception on this line:
> 
> DoCmd.OpenReport rpt_name, acViewDesign
> 
> 
> I understand the reason why, so here's my question:
> 
> Q) How can my VBA code modify a report in an accde file?

Opening in design view would only be required if you want to make a 
permanent change and no, you cannot do that at all in an mde/accde.  
However; you can run code in the various events of the Report to make on-
the-fly changes that are temporary to that report instance or section 
processing.  This would not allow all of the types of changes that could be 
done in design view, but quite a bit is still possible.

What exactly are you wanting to do?
0
Rick
1/21/2010 12:12:35 PM
=?Utf-8?B?QW5keQ==?= <Andy@discussions.microsoft.com> wrote in
news:D971E358-164B-42CE-B569-F79ABDE0DB77@microsoft.com: 

> I have some VBA that modifies a report's design.

Why? This is a terrible idea, and almost surely a mistake.

> However, the code throws an exception on this line:
> 
> DoCmd.OpenReport rpt_name, acViewDesign
> 
> 
> I understand the reason why, so here's my question:
> 
> Q) How can my VBA code modify a report in an accde file?

I'm going to answer your question with a question;

Q) Why do you think you need to modify the report design at runtime?
I've been programming in Access for over 14 years and never once
found a need to do that (or even contemplated). 

Explain what you're trying to accomplish and my bet is that there's
a 99.99% chance that it can be done without modifying the report's
design. 

-- 
David W. Fenton                  http://www.dfenton.com/ 
usenet at dfenton dot com    http://www.dfenton.com/DFA/
0
David
1/21/2010 7:17:12 PM
If you have the same problem, then it stands to reason the answer is the 
same.

My question would be: what are you doing that makes it necessary to modify 
the design of a report at runtime.  I only ask because I've been using 
Access daily since early 1993 and have never encountered a situation where 
that is a necessity.

If you'd explain what data you have, how it's structured, and what you want 
to accomplish (not how you want to accomplish it), it's entirely possible 
that someone might be able to offer a useful suggestion.

Oh, and that would also apply to the original poster in this thread.

 Larry Linson
 Microsoft Office Access MVP

"jero" <~jero@jero.net> wrote in message 
news:OHmL$comKHA.3476@TK2MSFTNGP06.phx.gbl...
> Hello,
> I have the same problem... and I create several reports...
>
>
> "John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> a �crit dans le 
> message de news: 72ufl5tb2lvc3jffcgfqubr4c1ibbi0m4o@4ax.com...
>> On Wed, 20 Jan 2010 22:26:01 -0800, Andy <Andy@discussions.microsoft.com>
>> wrote:
>>
>>>Q) How can my VBA code modify a report in an accde file?
>>
>> It can't. You must use an accdb.
>> -- 
>>
>>             John W. Vinson [MVP]
>
> 



0
Larry
1/21/2010 8:51:16 PM
Thanks Rick,

This is precisely what I needed to know.


I have already used a report's events for formatting, so I'm ready to go.

Thanks so much for your time.


Andy

> Opening in design view would only be required if you want to make a 
> permanent change and no, you cannot do that at all in an mde/accde.  
> However; you can run code in the various events of the Report to make on-
> the-fly changes that are temporary to that report instance or section 
> processing.  This would not allow all of the types of changes that could be 
> done in design view, but quite a bit is still possible.
> 
> What exactly are you wanting to do?

FYI For Larry and David, too:

I need to format the report on the fly for several reasons, 2 being:

1) I have the same report that could be printed in different languages. They 
would look awful if I didn't format them properly. Creating many reports only 
wastes time when I update a report a few months/years later.

2) One report could have three levels of "security": All information, 
general internal usage, and for the public

Having one report and using code to hide/show sensitive areas saves so much 
time. Of course the report would need a little formatting to keep them 
looking good after some controls/sections have been hidden.

0
Utf
1/24/2010 7:50:01 AM
Reply:

Similar Artilces:

Steel tube design
I want to design a structure in Viso for Enterprise Architects using both square and round steel tubes, welds, angles and so on. is this possible or do I need someother software Thanks All It's certainly possible, but not what Visio was designed for. You'd probably be much better off doing the mechanical design work in a program more suited for it and importing the results into Visio if you need the additional functionality it provides. Randall Arnold "A.J." <anonymous@discussions.microsoft.com> wrote in message news:F01A36FD-14D5-4B26-B04D-F36EAEE01C67@microsoft.c...

table / query design
Hello, I would like to ask advice on database / query design. I intend to create a salary calculator in Access 2007. In my plan there are different job positions and different salary categories for each job positions. For example job positions: boss assistant worker And there are salary categories: Normal Saturday Sunday 48hours Then I could combine different job positions with different salary categories. My tables are: tbl_jobpositions jobpositionsID basicsalary tbl_salarycategories salarycategoriesID salarycategory tbl_salaries salariesID jobpos...

Accde Problem?
Hi Guys, I made accde from my accdb database. But nothing is working in accde file ( no command button is responding). Please help to resolve this problem. Regards. Has the folder where your accde is located been defined to Access as a Trusted Location? If you're trying to run it using the "full" version of Access, click on the Office button (upper left-hand corner), choose Access Options at the bottom of the dialog, select Trust Center on the left hand side, Click on the Trust Center Settings button, choose Trusted Locations on the left and click on the Add n...

Design guides
For PPT 2007: The design guides often disappear when I change slide size or orientation (landscape to portrait). Alt-F9 restores them (sort of), but I can't grab and move them? Am I missing something? There's a hotfix Ken Link here http://www.pptalchemy.co.uk/PowerPoint_Guides.html -- john ATSIGN PPTAlchemy.co.uk Free PPT Hints, Tips and Tutorials http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html "Ken Eden" wrote: > For PPT 2007: > The design guides often disappear when I change slide size or orientation > (lan...

data type for a photograph in design view
I want to add a photograph of items to my table in design view. I do not know what to enter as the data type to be able to add photos. Where do I begin? And what are the next steps? ...

? O-ishT: Designing an About Box
Hi, I am trying to get some of my-far too many-half-finished projects out, but I need to properly brand them first. That's proving to be something of a stumbling block because I need to design a good About box; the default MFC one is rather banal. (Of course even after I get that part done, I still have to do the most dreaded parts before their release-ready: manuals, blech!) I'm not bad at creative things, but I am not really an artist, so I find this sort of thing tedious and frustrating. I tried searching Google Images for "about box" for inspiration, but I came up relat...

Convert db to accde
Hi there, I am working in Access 2007 and have recently converted a front-end to accde. When opening this new accde db though, none of my code can be run (all linked to command buttons on menus with click() event). Am I missing something or could there be another reason? Thank you in advance, Has the folder in which the accde file exists beed added as a Trusted Location? -- Doug Steele, Microsoft Access MVP http://www.AccessMVP.com/DJSteele (no e-mails, please!) "PsyberFox" <PsyberFox@discussions.microsoft.com> wrote in message news:F2925F78-B97F-...

Need Modify/Design Permission is stopping me from converting my database.
When I try to convert an access 1.x database to access 2.0, I get an error message "Need Modify/Design Permission". The database was not created with any security. How can I get past this error? ...

Access 2007 Design view performance on Vista vs XP
Hi I tried a search but found nought. I have a dual core, 2GB Vista machine and a single core XP machine both connected to the same 2003 file server. My application is a sales order processing package ported from Access 97 to Access 2007. Performance seems broadly comparable (and acceptable) in terms of create/read/update/delete operations across the two machines on the same database. However, when making changes to form or report design, particularly those with subforms/reports the XP machine opens the forms almost instantaneously, while the Vista machine pauses for anything up to 30...

Error Starting FRx Designer
The FRx client software (version 6.0.81, engine is same as version number) is running on a Windows XP PC without any service packs installed. After logging into Solomon IV 5.0 client(version 5.00.1773) as the user, when I logon to FRx Designer, I receive the following error message: (CheckOFSIConnection)-2147218358: [IM002] - [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. I have the database on the solomon server added as a SQL Server in ODBC on the user's PC Any suggestions?? Thanks. Is the datasource name the same as specified in Frx for...

modifying predefined page designs (or creating a variation of predefined page designs)
I have inserted a photo gallery using: INSERT / PAGE / PHOTOS / PHOTO GALLERY WITH LINKS. This generates a main gallery page with 12 images, each linked to a photo detail page. My problem is that I would like to modify the format of the photo detail pages--but preferably before inserting the photo gallery so I do not have to modify all 12 photo detail pages every time a gallery is added. I cannot find the photo detail page definition/template. Can it be modified? Can I create a modified version PHOTO GALLERY WITH LINKS based on the original? Any help would be greatly appreciated! Thanks...

Best table design for record of game played
I have table that I copy and paste append from the internet the fields are: Date played/Season/Home/home score/visitor/visitor score/margin/nuetral field/location My question is "is this a reasonable good normalization" it maybe complicated because data is suppied in this format and is worth reconfiguring into mulitiply tables? I have some pretty complex(time consuming) queries that rely on this data - one using 2000 loops through two queries that takes 24 hours to complete on a dual core processor. Suggestions? -- David McKnight On Wed, 26 Sep 2007 14:36:00 -0700, David ...

Design question
So I'm developing a new application for Windows Mobile (WindowsPhone) that will use a REST API I'm developing to interact with a backend MySQL server. While I need to make access secure (it's a medical app), I don't want the user to constantly have to hit the user table of the database every time they want to do an API call as that table could have thousands of rows and could slow down access a bit. So my thought is to use sessionID's of sorts. When the user does the first call to the API (which should be a login call since they need to login to the app), t...

Pivot Table Design
Hello, I am working on learning Pivot Tables and wanted some advice. I would like to use the Pivot Tables to work with state testing data. Fields that I would be working with would include: Student Name Student Grade Level Race Special Ed (Y or N) English Language Learner (Y or N) Free and Reduced Meals (Y or N) Math Level (1, 2, or 3) Math Score (a 3-digit raw score) Reading Level (1, 2, or 3) Reading Score (a 3-digit raw score) I would like to be able to generate reports that would show the students in a race that scored at a certain level, or students in a race, who are free and re...

Creating accde file
I am in the final stages of creating my database in access 2007 and it will not allow me to create an accde file when I click on the make accde button. It comes up with an error message saying 'Microsoft Office Access was unable to create the .accde, .mde, or .ade file' Please help - I would really like to do this as I don't want the users to play around with the code etc. Thanks in advance. Here's a checklist of things to work through: http://www.access.qbuilt.com/html/conversion.html#CannotMakeMDE -- Allen Browne - Microsoft MVP. Perth, Western Aust...

Locked VBA causes Access to crash with ACCDE files
Good afternoon everyone, I discovered a problem today with Access when I tried to unlock the VBA project with an ACCDE file. Everytime I enter in the password, Access immediately crashes, and the Windows Error Solver/Report then pops up. This problem has happened consistently, and only with this file format; it does not happen with ACCDB files. I would like to know if this is a known problem, and whether there is a solution to this matter. Thanks in advance, Gene My understanding is that you create a .accde for this very reason...so no one can access the code. I recre...

Designing a legend from a different series
I have a Pie Chart with Prim Regions of resorts and a count of res at each resort. The regions are abbreviated but also included in the table are full names. I would like my pie chart to use abbr. and the legend to use full names. How can I accomplish this? Have you considered using a subreport with a record source similar to the charts Row Source with the matching colors to replace the legend? -- Duane Hookom Microsoft Access MVP If I have helped you, please help me by donating to UCP http://www.access.hookom.net/UCP/Default.htm "cmiller" wrote: > I have a Pie Chart ...

vba code not working in accde
Hi, Hope someone could help me out. After I converted my database to ACCDE, my form buttons with vba code stop working. Am I missing some steps that I should do before converting? Thanks, Ray Make sure that the database is in a trusted location. Office button, Access options, Trust centre, Trust center settings, Trusted locations, Add new location Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "RayNDM83" <RayNDM83@discussions.microsoft.com> wrote in message news:38634EB0-E0E7-4C2D-B463-B7445061A237@microsoft.com... > Hi, > Hope...

Access 2007 accde format
Is access needed to open an accde database? If so, what is needed to compile a database to an executable to run as a standalone like an mde file in Access 2003? TIA -- Greg "Greg" <Greg@discussions.microsoft.com> wrote in message news:9BA1B9D9-2444-41B1-81A5-F0088CF599BB@microsoft.com... > Is access needed to open an accde database? If so, what is needed to > compile > a database to an executable to run as a standalone like an mde file in > Access > 2003? An ACCDE file is exactly analogous to an MDE file, but neither one is truly a standalo...

Query design question?
Query1 retrieves data for 2,000 records from a series of linked tables that have about 100,000 recordset Query2 retrieves data for 5,000 records from another series of linked tables that has about a 100,000 recordset as well. Query1 and Query2 are linked on a customer ID (e.g.) Should there be a simple join between Query1 and Query2 on Customer ID, or would there there be a benefit to limiting the records in Query2 first? Yes, SQL Server app - have an old stopwatch, but didn't know if some general guidelines applied. "Jerry Whittle" <JerryWhittle@discussions.micros...

What does "(Bulk)" designation mean on email
I had a bunch of email show up suddenly all prefixed with (Bulk). No pattern of sender nor date sent. Some were two weeks old. Does anyone know what this means or what happened. Sound like something added by integrated anti virus or spam app, or possibly your ISP AV/Spam filters, nothing to do with Outlook "Mobydick" <Mobydick@discussions.microsoft.com> wrote in message news:F8056B15-6391-43F2-899C-47DC8F2B369E@microsoft.com... >I had a bunch of email show up suddenly all prefixed with (Bulk). No >pattern > of sender nor date sent. Some were two we...

Invoice Designer not saving custom designs
Is anyone else running into an issue of Invoice Designer not saving custom designs? It seems to save ok, but the new invoice is not available from within Money Small Business 2005. See this: http://money.mvps.org/faq/default.aspx#Business (second article in that section) -- Glyn Simpson, Microsoft MVP - Money http://money.mvps.org Check http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny for UK tips and fixes for MS Money. To send Microsoft your wishes or suggestions, use http://register.microsoft.com/mswish/suggestion.asp or http://www.microsoft.com/uk/support/money/feedback...

Design of connectors
Hello I need some help to optimise our systems, which I inherited. Our company has 2 sites, connected with a sufficient link of 1 mbit. Site 1 has an Exchange 2003/SP1 server with an address 10.0.0.1 and site 2 has an Exchange 2003/SP1 server with an address 20.0.0.1 Site 1 has an backup Internet link of 256 mbit to ISP1 and Site 2 has a main Internet link of 1 mbit to ISP2 (we are using ISA 2004) All internet traffic flows from Site1 to SiteB, through ISA and so on. How should I configure Exchanges SMTP connectors and routing group (RG) connectors at both sites to achieve maximum reliabilt...

Acess 2007
hello, i am having a problem creating a .ACCDE file from an Access 2007 .ACCDB file. its somewhat large application, about 80 megs. it was originally an Access 2000 app that somebody else wrote for our user base, which ran it as a .MDE. i have now converted it Access 2007 .accdb, and am to use the "Make ACCDE" function off the Database Tools ribbon bar. upon doing so it says i need to enable the content as a security feature. no problem. afterward tho, it reports: "Microsoft Office Access was unable to create the .accde, .mde, or .ade file." ....it has more info under...

Banner on Design Jet 450C Printer
Ok I am trying to print a banner on this printer 6' long by 2'wide. I have tried everything including changing the overlap..the paper size and paper source but I cannot get this banner to print on one sheet. Has plenty of space left on the sheet but cuts my words off and then prints them on the next sheet. On the page set up have the application size set to 72X24 but it still cuts off my banner. Any ideas. I have the paper roll size set to 24" which is what is loaded on this printer... It's been awhile since I printed a banner and I know there is a trick to this. Th...