473,287 Members | 3,253 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,287 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 3010
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.