473,386 Members | 1,764 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 2007 - Using Subforms in Reports

Hi there

In MS Access 2007, I have a Form which contains fields that are Visible = False in certain circumstances, and this works perfectly.

When I use this form as a Subform in another form, this also works perfectly and the "hides" shown when appropriate.

I would like to use this same Subform in a Report, but the "hides" do not work correctly in the Report.

Am I asking the impossible?

Many thanks for your advice

Viv"
May 30 '10 #1
3 3014
missinglinq
3,532 Expert 2GB
What code are you using and in which event(s) in the form?

Linq ;0)>
May 31 '10 #2
Hi

I am using code like

Field A.visible = false

and then later

If something matches something else then

Field A.visible = true

On the Form, I am using this code on On Current, but I have also tried it on virtually everything else - on Unload, on Load, - everything.

When I embed this form as a subform in a bigger Form, it works perfectly, with the hides and reveals working correctly.

However, if I try to embed this form as a subreport (in a Report) then the hides and reveals just do not work. My son tells me that this is because the Report does not know which is the Current record (i.e. the code is On Current in the form). However I have tried also putting the code into the Report in the On Print and On Format events, but I just get a message that "Field A does not appear on this Report" which is quite correct, the field is not on the report but on the original form which now appears as subreport.

I think I am trying to do the impossible, but it would be so nice if it would work. All I am trying to do is to have data in Form A and be able to print that data into a Report.

However, if I change the layout of Form A, it would be good if the layout of the subreport would automatically also be changed (because it is the form really) - whereas at the moment I have to keep a copy of the original form and then paste everything into a Report - and remember to make the changes to the Report each time I change the Form.

Any ideas?

Viv
May 31 '10 #3
@missinglinq
Hi

I am using code like

Field A.visible = false

and then later

If something matches something else then

Field A.visible = true

On the Form, I am using this code on On Current, but I have also tried it on virtually everything else - on Unload, on Load, - everything.

When I embed this form as a subform in a bigger Form, it works perfectly, with the hides and reveals working correctly.

However, if I try to embed this form as a subreport (in a Report) then the hides and reveals just do not work. My son tells me that this is because the Report does not know which is the Current record (i.e. the code is On Current in the form). However I have tried also putting the code into the Report in the On Print and On Format events, but I just get a message that "Field A does not appear on this Report" which is quite correct, the field is not on the report but on the original form which now appears as subreport.

I think I am trying to do the impossible, but it would be so nice if it would work. All I am trying to do is to have data in Form A and be able to print that data into a Report.

However, if I change the layout of Form A, it would be good if the layout of the subreport would automatically also be changed (because it is the form really) - whereas at the moment I have to keep a copy of the original form and then paste everything into a Report - and remember to make the changes to the Report each time I change the Form.

Any ideas?

Viv
Jun 1 '10 #4

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

Similar topics

2
by: Wayne | last post by:
I've been having a click around Access 2007 this afternoon and have discovered some things that range from annoying to alarming. My Access 2003 menu bars, which I, like many others, use...
2
by: moses40 | last post by:
I need help importing an excel spreadsheet into an existing access table using vba. However I have a few requirements. 1. It needs to prompt the user to specify where the spreadsheet is 2. It needs...
1
by: AccessHunter | last post by:
Hi, I am trying to create a new application to work with my SQL server database from my Access 2007 using the upsize wizard. It gave me an error saying, "The upsizing wizard cannot convert your...
1
by: transpac80 | last post by:
Problem with SQLPassthrough in Access 2007 using DAO I have this piece of VBA code from inside Access to retrieve data from external database (SQL or Oracle) sConn =...
3
by: dstork | last post by:
Has anyone else experienced Access 2007 crashing when users right click on the subform (with the intention to use the copy feature in the shortcut menu). I went through Allen Browne's...
5
by: sphinney | last post by:
I have data in a few external Access tables that I want to link to my Access 2007 database. Depending on situation (and permissions of the person using the database) I want to dynamically link to...
0
by: ABinBoston | last post by:
Is it possible to change the AutoFormat in Access 2007 using code. There are a number of named auto format themes - like Apex, Aspect, Civic, etc... I would like to have an Access database,...
0
by: ARC | last post by:
Hello all, For right-click (shortcut) menus in access 2007, I've been using a round-about method of opening access 97 on an old computer, modifying my own custom shortcut menus, then importing...
1
by: kfry | last post by:
I am having an issue maybe someone can help with. I have written an application with Access 2003 on my XP pc. I then package it and install it on my VISTA Access 2007 PC. When I do this the wrong...
8
by: jerken | last post by:
Im working in Access 2007 using two Combo boxes to select a category then product type. I am trying to get a couple fields to be displayed based on what the values are in the combo boxes. I have the...
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.