Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On opening of report - if, then type question 1

Status
Not open for further replies.

webfaktor

Technical User
May 22, 2001
22
0
0
Hi - I have a unique record identifier within the records I report known as "MaterialNumber"

MaterialNumbers can be of two distinct types, for example:
M0001.01 (8 digits in length total)
M0001.01.01 (11 digits in length total)

The question I would like to ask of the query from which the report is based and have it perhaps performed when the report opens is: "If the MaterialNumber is 8 digits in length, then look and see if any 11 digits in length MaterialNumbers exist that are identical to the 8 digit material number with their first 8 digits, and then to report these 11 digit Material Numbers as well as the 8 digit Material Number from which they are derived"

Any help you would care to share is very much appreciated!

Regards,

WF
 
Hi,
You can add a Sorting and Grouping level to the report, but don't necessarily have to add any group headers or footers. You can set the "Group Interval" to 8 (the 1st 8 characters of the string), which will keep all the "M0001.01" items together. Is this what you are looking for? If not, please respond back to this post.
HTH,
Randy Smith
California Teachers Association
 
Randy, thank you for the response.

My circumstance is trickier than the good solution you've offered because it would be only when the report references an 8 digit MaterialNumber that I would like this functionality activated. When the report references an 11 digit material number I would NOT want this functionality to occur.

Here’s some FYIs (sorry I didn't post these with first message.):

· An 8 digit MaterialNumber identifies a document.
· An 11 digit MaterialNumber identifies a portion of a document.
· A document may or may not be divided into sections that are identified by 11 digit MaterialNumbers:
If so, the Document would be summarized/identified as follows, for example:
M0001.01 = Main Document Number
M0001.01.01 = Section 1 of main document M0001.01
M0001.01.02 = Section 2 of main document M0001.01
M0001.01.03 = Section 3 of main document M0001.01
Etc. . .
If Not, the Document would be summarized/identified as follows, for example:
M0001.01 = Entire Document Number with no sections

Thus - a person may only want to see a report on (per above example) M0001.01.03. If this were the case, they would not want to see M0001.01.01 & M0001.01.02.

On the other hand, if a person wants to see M0001.01, I want to make sure the report calls up M0001.01, M0001.01.01, M0001.01.02, and M0001.01.03.

Again - thanks,

WF
 
Hi,
I have been using a technique where I give the user a form to select the various options. For instance, in your case I might give them a form where they can select the level of detail they want to see in the report. This can be "Full Detail", or "Summary". This can be placed in a listbox called "lstDetail". Dependent on their answer, you can give them exactly what they want. You will only need to create one report!!! The Open event of the report will contain the code necessary to determine which version of the report to print.
Here is what your code might look like:
If Forms!frmUserSelection!lstDetail = "Summary" then
Me.Detail.Visible = False
End if

HTH,
Randy Smith
California Teachers Association
 
WF,

Normalize your data. This field should be split into three fields. Then you queries will become trivial. As it is, you're going to go through a lot of pain to get what you want.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developers' section of the site for some helpful fundamentals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top