aero.space.junkie.1
New member
- Local time
- Today, 15:53
- Joined
- Jan 7, 2012
- Messages
- 3
hi all,
I am writing lines to a txt from a module. here's a sample line that I have:
Sometimes these lookups return null values because the lookup failed. That's fine, but the txt receives a zero length string instead of "null", which is what access returns by itself. I know there are multiple issues with sending data to txt files from visual basic, as the stream manipulates some of the values when and where it needs to. Is this one of those issues?
I need an indicator in the txt that tells me if my lookup returned null or not. but the only thing I can think of is to write something like this:
But that is just way to cumbersome to sift through in a module. I have 350 of these code lines right now, but only 100 or so have anything in them. The rest just return zero-length strings because there are no tests associated with them.
Does someone here know how I could differentiate the failed tests from the dummy tests? The failures cannot return blanks. That's the issue. thanks!
I am writing lines to a txt from a module. here's a sample line that I have:
Code:
Write #1, "332: " & DLookup("[STATION IDENT]", "STATIONS", "[STATION IDENT] = 'YYY' AND [REGION] = 'ZZ")
& " / #Plans With Reference: " & DCount("[FIX]", "PLANS", "[FIX] = 'AA' AND [REGION] = 'QQ'
AND [PLAN IDENT] = 'N17' AND [AREA] = 'CHINA'") & " (needs to be > 0!)"
Sometimes these lookups return null values because the lookup failed. That's fine, but the txt receives a zero length string instead of "null", which is what access returns by itself. I know there are multiple issues with sending data to txt files from visual basic, as the stream manipulates some of the values when and where it needs to. Is this one of those issues?
I need an indicator in the txt that tells me if my lookup returned null or not. but the only thing I can think of is to write something like this:
Code:
Write #1, "332: " & IIF(DLookup("[STATION IDENT]", "STATIONS", "[STATION IDENT] = 'YYY' AND [REGION] = 'ZZ") = NULL,
"NULL", DLookup("[STATION IDENT]", "STATIONS", "[STATION IDENT] = 'YYY' AND [REGION] = 'ZZ"))
& " / #Plans With Reference: " & DCount("[FIX]", "PLANS", "[FIX] = 'AA' AND [REGION] = 'QQ'
AND [PLAN IDENT] = 'N17' AND [AREA] = 'CHINA'") & " (needs to be > 0!)"
But that is just way to cumbersome to sift through in a module. I have 350 of these code lines right now, but only 100 or so have anything in them. The rest just return zero-length strings because there are no tests associated with them.
Does someone here know how I could differentiate the failed tests from the dummy tests? The failures cannot return blanks. That's the issue. thanks!