473,320 Members | 1,845 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,320 software developers and data experts.

Linking subreports on empty string

122 100+
I have a main report that show project details, grouped by Company and Location. Location is a text value that can be blank (empty string) if the company does not have multiple locations (and sometimes for the main location of a company that does.)

I have a subreport that needs to display, and I have linked it to the master using Company and Location. This works fine if Location is filled in, but if it is an empty string that subreport is blank. How can I get these to display? Since you can join tables on an empty string I assumed you could link reports that way as well.

I also tried this code in the onFormat event of the main report's detail section as a work around:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2.   If Location= "" Then
  3.     subClasses.Report.Filter = "Location = ''"
  4.     subClasses.Report.FilterOn = True
  5.   Else
  6.     subClasses.Report.Filter = ""
  7.     subClasses.Report.FilterOn = False
  8.   End If
  9. End Sub
but I get error 2101: The setting you entered isn't valid for this property when I set the filter.

Any suggestions as to how I can link the subreport with the main report? There's a fair amount of existing code that is expecting a blank string, so I'd prefer not to change how the data is represented, but I can if need be.
Jun 24 '10 #1

✓ answered by jimatqsi

Just to keep it very simple, I would add a column to the queries for both master and subreport called "LocationLink". LocationLink would be Nz(Location,"none"), or "Iif(Location='',"none",Location) if the location is not stored as a null.

Then link the master and sub reports on LocationLink. Location is still a blank and all of your other code still works.

Jim

2 2047
jimatqsi
1,271 Expert 1GB
Just to keep it very simple, I would add a column to the queries for both master and subreport called "LocationLink". LocationLink would be Nz(Location,"none"), or "Iif(Location='',"none",Location) if the location is not stored as a null.

Then link the master and sub reports on LocationLink. Location is still a blank and all of your other code still works.

Jim
Jun 25 '10 #2
gershwyn
122 100+
Ah, thank you. I was hoping for a simple solution like that.
Jun 25 '10 #3

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

Similar topics

6
by: Chris Connett | last post by:
I have an interesting problem with eval(). ---Background Info--- The program I'm working on launches a separate process with a popen to do some highly specialized processing of input, then this...
10
by: David Graham | last post by:
Hi I have been busy going through the last weeks postings in an attempt to absorb javascript syntax (I guess it's not possible to just absorb this stuff in a passive way - I'm getting way out of...
3
by: krofak | last post by:
Today, I noticed different empty string behaviour then I am used to. Before, empty string was treated as null, so statement vcResult := 'something' || '' would result in vcResult = ''. ...
11
by: Dan Bass | last post by:
which one do you use and why? MyString == null || MyString == "" vs MyString == null || MyString.Length == 0
4
by: web1110 | last post by:
I have an array of of 5 string elements. I put values in 3 of them. Yet when I loop over them, I do not catch the empty string. The code output below does not include "Empty" stringx=new...
21
by: M D | last post by:
You know how you assume you know until you find out you don't know. Well, I typed into a function definition "..., new String("")). I know what I want. Everyone reading this knows what I want....
3
by: scorpion53061 | last post by:
I have little hope of resolving this as I have had to contact outside help. But I thought I would post it here to see if anyone could add an idea or solution. 1. I have a form in a Class...
26
by: Neville Lang | last post by:
Hi all, I am having a memory blank at the moment. I have been writing in C# for a number of years and now need to do something in VB.NET, so forgive me such a primitive question. In C#, I...
7
by: tomlebold | last post by:
Are the following two validation the same: 1) IsNull(Me.ColumnName) and Me.ColumnName = "" 2) Me.ColumnName """ It would seem to be better to use: Me.ColumnName """
2
by: Jay | last post by:
I have a SQL Server table with nvarchar type column which has not null constraint. I am inserting empty string ("") from Java to the table column. When I export this table into .csv file using bcp...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.