473,226 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

MS Access 2010 - Save Form as Report automatically, with code on Format

I have a Form, the fields of which I also use to copy and paste into a Report. However, each time I make design changes to the Form, I have to remember to copy and past the changes into the Report.

I cannot just save the Form as a Report, because the Report has some VBA code on the On Format event.

Is there any way I can do VBA code to tell it that if any changes have been made to the DESIGN of the form, then Save As a Report, with the On Format code of xxxxxxx?

Many thanks
Aug 18 '10 #1
6 8806
Stewart Ross
2,545 Expert Mod 2GB
Sorry Viv, but there is no easy way to do what you ask. Forms and reports are entirely separate objects, and even if there was an event which could be triggered by a design change of a form (which there isn't) there is no in-built method which can update your report from your form.

Aug 18 '10 #2
Thanks for your reply. I thought I may be trying to do the impossible, when looking down the Events.

I thought I might be able to do something on the On Close event, where I could tell it to Save the form as a Report. I know this is possible manually, but did not know what VBA code to use.

And then I thought, 'Well, if I could tell it to add the VBA code on the On Format event of the Report it will be creating................' but I think that is just wishful thinking.

I will just have to remember to do all this myself, manually.

Anyway, thanks for having a think about it.

Aug 19 '10 #3
Stewart Ross
2,545 Expert Mod 2GB
Hi Viv. Just to avoid possible confusion, the events such as On Close occur when the form is in use and is closed by the user or the application.

These same events don't actually occur in design mode, so closing a form you have opened in design mode does not trigger an On Close event that you can trap.

Of course, switching an open form to design mode will trigger form events as a result of the open form losing focus, but the trappable event sequence then stops once you have the form in design mode.

Aug 19 '10 #4
As you can probably tell, I am not at all "up" with this VBA thingy.

I would not mind if, every time I close the form, it ran some code to say Save this Form as a Report - at least that way I would know that the Report is totally up to date, design-wise. Or are you saying I could do that on the On Losing Focus event?

Either way, that would be a help, but what code do I use?

Then, would it be possible to create a Macro to tell the Report that say, On Open, run some code On Format?

I'm probably still asking for ths impossible......

Aug 19 '10 #5
Stewart Ross
2,545 Expert Mod 2GB
Whilst not impossible to achieve with some level of bespoke coding, Viv, you're still showing some confusion over the events and how they are triggered. The events are used by designers to provide a programmed response to users opening forms, closing them, updating fields and so on. They are not intended to fire when designers are modifying the underlying design, as this is just a very small part of the lifecycle of a form or report.

I would say at this stage that the effort you could expend for what is likely to be a very small gain in overall productivity is far outweighed by the time it would take for what is in effect a one-off application.

I find that designing an Access report is a time-intensive process - regardless of what the built-in wizards can do to start you off. Resizing fields, aligning them, and doing all the other bits and pieces that make the report readable to an end user takes a lot of effort.

In general, there is simply no easy way that a form can be used as the basis for an automated translation to a workable report. I can't say that what you want to achieve is impossible; what I can say for sure is that if you decide to design a new wizard to do it for you the time you will spend perfecting it will far outweigh the time it would have taken you to do it manually.

The cost-benefit question you have to ask is 'am I likely to need this tool so often that I can afford to spend several months learning how to set it up and then perfecting it?'. If you can answer Yes then go ahead; if not, and my advice would definitely be NOT, continue doing it manually!

Aug 19 '10 #6
Hi Stewart

Thanks for all your time and thought on this matter. Looks like I'm asking for the impossible.

The nearest I've got is to create a Command Button which Saves the Form as a Report. This lets me over-write the original report, and from there I can put an Event on the On Format line, adding in my VBA code manually.

Once again, thanks for your time.

Aug 19 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

by: John | last post by:
(access 2002) Anyone have any suggestions as to what may be causing access to not save form changes after I "tell" it to, exit database, then re-open later to discover the changes had not been...
by: Scott Sabo | last post by:
I have a form & report based on a query which shows details about employees performance reviews (hire date, review date, review submital date, etc). We do 90 day probation reviews as well and I...
by: John Michael | last post by:
I have created some password routines to protect certain forms from access without a password. This allows me to create some security for apps that will be used on diff machines for users that...
by: Tiga | last post by:
Surely this was possible in Access 97. Has it gone or am I just not seeing the wood from the trees. Any help Grateful. Regards
by: jjbnfo | last post by:
Hi all, I'm trying to edit VBA code in my mdb file for a form. Basically, I want to delete and comment out some lines of code. (I'm quite good at VBA, so I don't need help there). I'm...
by: Cron | last post by:
Hi I'm trying to make a form that makes it optional for the user to save the inputted data. If the user does not tap the save button before leaving the form, the data is silently discarded. This...
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I am using reporting service with asp.net. I want to save a report snapshot in some time. How do I do this in asp.net? Is there any web service to do this? Thanks in advance! -Billy
by: phill86 | last post by:
Hi, I have an access 2010 database that I want to convert to an SQL Server database and I need to know if the data macros in access will still work in the SQL database or will i have to create...
by: jaad | last post by:
Hello, I have a database that was written in access 2007 on my pc. I wanted to work off site with the database so I uploaded it onto my laptop which is loaded with access 2010 beta. When I...
by: sierra7 | last post by:
It seems Access 2010 is associating an 'input mask' or field type with a combo box when a form is opened, even though there is no Format setting on the control. I have a form which has been...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.