473,386 Members | 1,693 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,386 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
Viv
Aug 18 '10 #1
6 8815
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.

-Stewart
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.

Viv
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.

-Stewart
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......

Viv
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!

-Stewart
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.

Viv
Aug 19 '10 #7

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

Similar topics

1
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...
1
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...
1
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...
1
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
2
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...
2
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...
2
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
1
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...
5
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.