473,806 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Option Button Values and Date Creator Problems on a Report.

48 New Member
Hi there,

I have a two problems concerning option button values on a report and data report creator reports.

The situation:

I have three option value boxes two have 3 option and one has only two option buttons. They have values 1, 2, 3. Everything is standard. Now when I create the report, I have only the number for each record on the report, which is kind of ugly and not user-friendly. Is there a chance to turn this values into actual text?

For example. optButton with value 1 should receive Internal.

I have tried to overcome the problem with an iif, doesn't do anything.

Another problem that I have. I have build an "search date creator report". Basically, that tool creates a report when the user types in Start Date and End Date. However, I would like that this report creator also shows Date from to (empty).

Here's the code:
Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub cmdReport_Click()
  3.     On Error GoTo Err_cmdReport_Click
  4.  
  5.     Dim stDocName As String
  6.  
  7.     stDocName = "rptDateParameterReport"
  8.  
  9. 'Check values are entered into Date From and Date To text boxes
  10. 'if so run report or cancel request
  11.  
  12.     If Len(Me.txtdatefrom & vbNullString) = 0 Or Len(Me.txtDateTo & vbNullString) = 0 Then
  13.         MsgBox "Please ensure that a report date range is entered into the form", _
  14.                vbInformation, "Required Data..."
  15.         Exit Sub
  16.     Else
  17.         DoCmd.OpenReport stDocName, acPreview
  18.     End If
  19. Exit_cmdReport_Click:
  20.     Exit Sub
  21.  
  22. Err_cmdReport_Click:
  23.     MsgBox Err.Description
  24.     Resume Exit_cmdReport_Click
  25.  
  26. End Sub
  27.  
I do not see where the vba is actually doing something with the values typed in, except persuing a test if something is in the boxes. Is it even possible to search empty values?

Thanks for the comments and hints.
Aug 21 '07 #1
13 2436
FishVal
2,653 Recognized Expert Specialist
Hi there,

I have a two problems concerning option button values on a report and data report creator reports.

The situation:

I have three option value boxes two have 3 option and one has only two option buttons. They have values 1, 2, 3. Everything is standard. Now when I create the report, I have only the number for each record on the report, which is kind of ugly and not user-friendly. Is there a chance to turn this values into actual text?

For example. optButton with value 1 should receive Internal.

I have tried to overcome the problem with an iif, doesn't do anything.

Another problem that I have. I have build an "search date creator report". Basically, that tool creates a report when the user types in Start Date and End Date. However, I would like that this report creator also shows Date from to (empty).

Here's the code:
Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub cmdReport_Click()
  3.     On Error GoTo Err_cmdReport_Click
  4.  
  5.     Dim stDocName As String
  6.  
  7.     stDocName = "rptDateParameterReport"
  8.  
  9. 'Check values are entered into Date From and Date To text boxes
  10. 'if so run report or cancel request
  11.  
  12.     If Len(Me.txtdatefrom & vbNullString) = 0 Or Len(Me.txtDateTo & vbNullString) = 0 Then
  13.         MsgBox "Please ensure that a report date range is entered into the form", _
  14.                vbInformation, "Required Data..."
  15.         Exit Sub
  16.     Else
  17.         DoCmd.OpenReport stDocName, acPreview
  18.     End If
  19. Exit_cmdReport_Click:
  20.     Exit Sub
  21.  
  22. Err_cmdReport_Click:
  23.     MsgBox Err.Description
  24.     Resume Exit_cmdReport_Click
  25.  
  26. End Sub
  27.  
I do not see where the vba is actually doing something with the values typed in, except persuing a test if something is in the boxes. Is it even possible to search empty values?

Thanks for the comments and hints.
Hi, Sacha.

I guess the OptionGroup control is bound to some field in a table where it stores numerical values. You need to build a table

tblOptions
keyOptionID Long, PK (OptionGroup.Va lue)
txtOption Text (Text to replace OptionGroupValu e)

fill the table with an appropriate Number-Text couples
build a query based on rptDateParamete rReport.RecordS ource table/query to tblOptions join and set the query to rptDateParamete rReport.RecordS ource.

Now you can set ControlSource of a correspondent control in rptDateParamete rReport to tblOptions.txtO ption

Good luck.
Aug 21 '07 #2
alive84
48 New Member
Hi, Sacha.

I guess the OptionGroup control is bound to some field in a table where it stores numerical values. You need to build a table

tblOptions
keyOptionID Long, PK (OptionGroup.Va lue)
txtOption Text (Text to replace OptionGroupValu e)

fill the table with an appropriate Number-Text couples
build a query based on rptDateParamete rReport.RecordS ource table/query to tblOptions join and set the query to rptDateParamete rReport.RecordS ource.

Now you can set ControlSource of a correspondent control in rptDateParamete rReport to tblOptions.txtO ption

Good luck.
Once again, thanks to your help, I solved the first problem.

do you know, how I could change this WHERE part of my SQL-Query, so that it is optional to use "Date to"?

Expand|Select|Wrap|Line Numbers
  1. (((tblWork.StartDate)>=forms!frmReportDate!txtDateFrom) And ((tblWork.EndDate)<=forms!frmReportDate!txtDateTo));
  2.  
thanks,
Aug 21 '07 #3
FishVal
2,653 Recognized Expert Specialist
Once again, thanks to your help, I solved the first problem.

do you know, how I could change this WHERE part of my SQL-Query, so that it is optional to use "Date to"?

Expand|Select|Wrap|Line Numbers
  1. (((tblWork.StartDate)>=forms!frmReportDate!txtDateFrom) And ((tblWork.EndDate)<=forms!frmReportDate!txtDateTo));
  2.  
thanks,
Expand|Select|Wrap|Line Numbers
  1. (((tblWork.StartDate)>=forms!frmReportDate!txtDateFrom) And ((tblWork.EndDate)<=forms!frmReportDate!txtDateTo) OR IsNull(forms!frmReportDate!txtDateTo));
  2.  
Did you mean this?
Aug 21 '07 #4
alive84
48 New Member
Expand|Select|Wrap|Line Numbers
  1. (((tblWork.StartDate)>=forms!frmReportDate!txtDateFrom) And ((tblWork.EndDate)<=forms!frmReportDate!txtDateTo) OR IsNull(forms!frmReportDate!txtDateTo));
  2.  
Did you mean this?
Unfortunately not, because like that it shows me all records in the table. thanks
Aug 21 '07 #5
FishVal
2,653 Recognized Expert Specialist
Unfortunately not, because like that it shows me all records in the table. thanks
It shows all records from DateFrom if DateTo was not entered.
If this is not what you've wanted, then please clarify what you've meant saying
how I could change this WHERE part of my SQL-Query, so that it is optional to use "Date to"?
Aug 21 '07 #6
alive84
48 New Member
It shows all records from DateFrom if DateTo was not entered.
If this is not what you've wanted, then please clarify what you've meant saying
Sorry, I mean that I could search all DateFrom without setting a DateTo, but it should also be possible to set a DateTo (if wanted). Both choices should be possible.

For example: I set DateFrom as 01.01.2007 Empty DateTo, and it shows me now all records where DateFrom is >01.01.2007 with an empty DateTo.
But it should also be possible when I give this input: DateFrom 01.01.2007 and DateTo 01.09.2007
Aug 21 '07 #7
FishVal
2,653 Recognized Expert Specialist
Sorry, I mean that I could search all DateFrom without setting a DateTo, but it should also be possible to set a DateTo (if wanted). Both choices should be possible.

For example: I set DateFrom as 01.01.2007 Empty DateTo, and it shows me now all records where DateFrom is >01.01.2007 with an empty DateTo.
But it should also be possible when I give this input: DateFrom 01.01.2007 and DateTo 01.09.2007
So what is wrong with the criteria I've previously posted.
Here I've removed unnecessary brackets.
Expand|Select|Wrap|Line Numbers
  1. tblWork.StartDate>=forms!frmReportDate!txtDateFrom And (tblWork.EndDate<=forms!frmReportDate!txtDateTo OR IsNull(forms!frmReportDate!txtDateTo));
Aug 21 '07 #8
alive84
48 New Member
So what is wrong with the criteria I've previously posted.
Here I've removed unnecessary brackets.
Expand|Select|Wrap|Line Numbers
  1. tblWork.StartDate>=forms!frmReportDate!txtDateFrom And (tblWork.EndDate<=forms!frmReportDate!txtDateTo OR IsNull(forms!frmReportDate!txtDateTo));

the problem is that it shows me even Dates before 01.01.2007 when I am not entering anything in DateTo. However, when I enter a DateTo it shows me all records, where there is a DateTo in the Table. It would be neat, if it also shows me all records with DateFrom 01.01.2007 with an empty DateTo.

I have played around with the WHERE statement you gave me...but no solution yet.

thanks
Aug 21 '07 #9
FishVal
2,653 Recognized Expert Specialist
the problem is that it shows me even Dates before 01.01.2007 when I am not entering anything in DateTo. However, when I enter an DateTo it shows me all records, where there is a DateTo in the Table. It would be neat, if it also shows me all records with DateFrom 01.01.2007 with an empty DateTo.

I have played around with the WHERE statement you gave me...but no solution yet.

thanks
Post the whole SQL expression.
Aug 21 '07 #10

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

Similar topics

9
5729
by: Melissa | last post by:
What is the code to delete a command button from a form? Can the code be run from the click event of the button to be deleted? Thanks! Melissa
12
3292
by: Diego | last post by:
Can I validate (possibly with a compare validator) a Date entered by the user based upon his regional settings? I.e. if a user is american the format would be mm/dd/yyyy, if brittish dd/mm/yyyy Thanks, Diego.
2
3497
by: NishSF | last post by:
Would anyone have any suggestions/javascript code so that if one clicks the Radio Button "Yes" below he has the option of selecting any of the six CheckBox below. If the user clicks on Radio Button "No", he should not have the option of clicking on any of the six checkboxes. See Code attached. Thank you so much in advance for your help as I can't get to make this combo work. <p>Did you have any problems finding any of the information...
16
8056
by: TetoPR | last post by:
Hi, I'm trying to set up an Option Box in a form to feed a Parameter Query to be used as a filter. That field I want to filter is a Text field and has two posible values: "A" and "B". So my Option Box should have three options: "A" ; "B" : and "A" Or "B" (any). Pretty basic stuff. I can't get it to work, for staters it seems that only numbers are allowed as data types for option boxes, and if I try to use a combo box (I'm willing to use...
0
1658
by: aakash | last post by:
Hello Guys I am upsizing ms access project to give it a ms sql connectivity I am having problem in accessing form control values in ms sql function CREATE FUNCTION "ReportList DateRange"() RETURNS TABLE AS Begin RETURN
1
2503
by: Intrepid_Yellow | last post by:
Hi, I have the following code that runs my report generator. The user selects a table from a combo box, then whatever fields they want from a list box. (This part all works and the report runs fine). There is then a combo box they can select a field from (eg CompanyID etc) and then the list box below that contains the values (eg Microsoft, Novell etc). These are all multi-select list boxes. Now I can get the code to work if the user...
6
1786
by: ladybug76 | last post by:
Hello. Okay, so I have an Option Group with 6 reports on the Right hand side of a form. On the left, I have 4 command buttons. 1) Preview 2) Print 3) Save off 4) Email. I want the user to be able to select a report's radio button and click one of the four command buttons. Currently, Preview and Print work. But the Reports have parameters in their queries. I'm prompted for the values for the Print and Preview buttons, but for some...
2
2893
by: sara | last post by:
Hi I'm having a very strange problem and need HELP!! I have a form for the user to choose a report (radio button in an option group) and parameters (Dates, Season). Click the option button, it turns Black, and the "On Got Focus" event fires. The event shows or hides the parameters appropriate for that report.
25
11667
smithj14
by: smithj14 | last post by:
I have a form that has an option group (fraReports) which holds a list of reports to print. This part works fine. I select a report name and click print and that report opens. Now I want to add a text box to enter a service date that will open the selected report using the text box value (service date) to filter the report to only those dates. I have the field using the format "mmmm-yyyy" on all my forms and reports so it will show May-2009....
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.