473,320 Members | 1,987 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.

Handle Multple Reportint Options

9
it has been working excellently but I found a problem
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "RptSnapplingA5", _
  2.    acViewPreview, , _
  3.    "[Work]=-1", , _
  4.    "this is the title"
  5. [Reports]![RptSnapplingA5]![Notes].Visible = False
since I have another line that for this button hides the notes, the title also disappears
any other solutions for that - thanks a million
dovid

<This thread was split from>
set title of report based on button clicked on in the main form
Jan 8 '15 #1

✓ answered by Seth Schrock

The name itself wouldn't get passed through the OpenArgs, but a number which identifies the report name would. Thus in the code that he provided, you would replace "Report 1" with your report name that you associate with the number 1.

9 1026
twinnyfo
3,653 Expert Mod 2GB
If you don't want the notes to be visible, why not remove the control?
Jan 8 '15 #2
dovidg
9
I have 3 buttons on the main form
1 button prints with the notes, 2 print without notes
I use that Idea a lot, printing for me with notes, for the customer without etc. I can make separate reports, I was wondering if there is another way
thanks
Jan 8 '15 #3
twinnyfo
3,653 Expert Mod 2GB
Working with our usage of OpenArgs, how about sending an integer (1, 2 or 3).

Then, in your Report's OnOpen Event:

Expand|Select|Wrap|Line Numbers
  1. Select Case Me.OpenArgs
  2.     Case 1
  3.         Me.Title5 = "Report 1"
  4.         Me.Notes.Visible = True
  5.     Case 2
  6.         Me.Title5 = "Report 2"
  7.         Me.Notes.Visible = True
  8.     Case 3
  9.         Me.Title5 = "Report 3"
  10.         Me.Notes.Visible = False
  11. End Select
This allows you much more flexibility with your various controls.
Jan 8 '15 #4
Seth Schrock
2,965 Expert 2GB
Another option would be to send multiple sections separated by a colon in the OpenArgs, like this
Expand|Select|Wrap|Line Numbers
  1. "This is the title:True"
Then the Report's Load event can use the Split function to get the different parts.
Expand|Select|Wrap|Line Numbers
  1. Dim strArgs() As String
  2. strArgs = Split(Me.OpenArgs, ":")
  3.  
  4. Me.Title5 = strArgs(0)
  5.  
  6. If strArgs(1) = "True" Then
  7.     Me.Notes.Visible = True
  8. Else
  9.     Me.Notes.Visible = False
  10. End If
In this case twinnyfo's solution might be easiest, but this solution would work better if you can't really plan what the options would be.
Jan 8 '15 #5
dovidg
9
I don't see how twinnyfo's solution helps
from what I understand, we still don't have the title being defined as me.title = OpenArgs
we only have worked out whether the notes are visible or not in the onload rather than on the button that opens it.
am I wrong?
Jan 8 '15 #6
Seth Schrock
2,965 Expert 2GB
The name itself wouldn't get passed through the OpenArgs, but a number which identifies the report name would. Thus in the code that he provided, you would replace "Report 1" with your report name that you associate with the number 1.
Jan 8 '15 #7
dovidg
9
didn't get the split function to work at all
never got the title to show only half of the string - I still want to play with the function but any input would be appreciated
dovid
Jan 8 '15 #8
Seth Schrock
2,965 Expert 2GB
What was the title that you wanted to see? Did it include a colon? If it did, then you just need to change the character that you are using to split the string.
Jan 8 '15 #9
dovidg
9
I redid everything and it worked, don't know what happened the first time. it has given me new ways to work with access, thanks for everything
Jan 9 '15 #10

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

Similar topics

2
by: Alexander Ross | last post by:
I want a cookie that can have about 5 values. I was told to do something like this: to set the cookie the first time: setcookie("questions",$_POST,time()+60*60*24,"/","",0); then to add valus...
5
by: hue | last post by:
I am trying to parse command line options using getopt module. I have written the following Code import string import getopt def usage(): print '''haarp_make.py -- uses getopt to...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
14
by: Howard | last post by:
Hi, I recently had a problem where I decided to store objects in a vector. (Previously, I had always stored pointers in vectors). Well, naturally, when storing an object in a vector, using...
7
by: R. Bernstein | last post by:
optparse is way cool, far superior and cleaner than other options processing libraries I've used. In the next release of the Python debugger revision, I'd like to add debugger options: --help...
7
by: Leo Breebaart | last post by:
I have another question where I am not so much looking for a solution but rather hoping to get some feedback on *which* solutions people here consider good Pythonic ways to approach a issue. ...
1
by: madflytom | last post by:
Hello, I'm trying to move the options of one select list to another select list. The "source" select list is divided into optgroups, and the "target" select list is not. I want to somehow keep...
1
by: charmgirl | last post by:
hi, is it possible to have multple forms in a page. if yes than how to read data from multople forms ?
5
by: KingKen | last post by:
I have a situation whereby I have to enter many records in a db that only have one field that changes. For example software installed on a computer would give you many different rows of data with...
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.