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

Inputting age range through text boxes to generate report

68 64KB
Hi,
I have database in access 2007 with an 'Age' field. Now I a Form with two fields (Beginning Age and Ending Age) and a control button that when I entered the two ages in both fields and click the control button, it will generate a report of individuals that fall within that age range.

Any help on this?
Thanks
Dec 5 '12 #1
2 1470
zmbd
5,501 Expert Mod 4TB
You have a very general question; thus, the best I can do is tell you to use a "Select" query and I'd more than likly use the "Between" conditional or ">=" "<=" in some manner depending on the table design.
Dec 5 '12 #2
NeoPa
32,556 Expert Mod 16PB
One must assume, as you've left out most of the important details of the question, that you have a report built on a data source which has some sort of an [Age] field. You also have [FromAge] and [ToAge] controls on your form.

In such a situation you can run code behind the Command Button which :
  1. Formulates a Criteria string using code similar to :
    Expand|Select|Wrap|Line Numbers
    1. strWhere = "([Age] Between #%F# And #%T#)"
    2. strWhere = Replace(strWhere, "%F", Format([FromAge], "m\/d\/yyyy")
    3. strWhere = Replace(strWhere, "%T", Format([ToAge], "m\/d\/yyyy")
    See Literal DateTimes and Their Delimiters (#) for help with formatting dates for SQL.
  2. Open the report passing the criteria in your call using code similar to :
    Expand|Select|Wrap|Line Numbers
    1. Call DoCmd.OpenReport(ReportName:=rptXXX, _
    2.                       View:=acPreview, _
    3.                       WhereCondition:=strWhere)
This should open your report with only valid records included.

PS. Please remember to post all the required information in future questions.
Dec 5 '12 #3

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

Similar topics

7
by: Mark | last post by:
Hi All, I have a report which is based on a query which is used to produce QC check sheets. I have quite a few text boxes which are used to display questions depending on the value of one...
14
by: deercreek | last post by:
Could use some help. I don't know if I can even do whatI'm trying to do. I have a text box in a report under the details section. It will return a value for each line on a sepcific record set....
11
by: Edson Peacock | last post by:
I have a report with sub reports, one of the subreports have 12 text boxes that are 2" high and I want them all to grow if one goes to 3" high. If anyone has any suggestions they are very much...
4
by: ckpoll2 | last post by:
Hello, I have a report and am having a hard time summing some numbers. In the detail section of the report, I have 2 text boxes that have IIF statements in them. These IIF statements return...
4
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I have created a report. This report needs to display records between two dates entered by the user. I put two text boxes on the report so I can enter the start and end date - I set them to use an...
2
by: cynderborg | last post by:
I have three text boxes that are horizantally next to each other. I would like to create the look of a table on the report. The borders of all three text boxes will be visible in the report. What...
6
by: noe1818 via AccessMonster.com | last post by:
Just a quick question about lines: Is it possible to connect a text box (e.g. txtbx1 to txtbx2 and txtbx2 to txtbx3) with lines where txtbx1,2,&3 move up or down according to their values? Like...
5
by: ofilha | last post by:
I have created a report in design mode. However, some of the fields i need are dynamic. That is, i have a series of fields text boxes mostly that must show up only as needed. I also have some...
4
by: ckpoll2 | last post by:
Ok, so I'm wondering if what I need to do is even possible because I haven't been able to figure out how to do it and I haven't seen any similar posts on here. In a table, I have a series of...
1
by: stewdizzle | last post by:
I have a from with three radio buttons (same group) and three text boxes. The radio buttons give the user a choice of uploading one, two, or three images. Currently, I have the text boxes load as...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.