473,387 Members | 3,821 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,387 software developers and data experts.

List Dates in Report from Start to Finish

I am using MS Access 2007-2016
I have a report that receives its information from a form, what I am trying to make happen is when the report is loaded it lists the date issued in the first text box and list all consecutive dates until it reaches the projected end date. I have been able to do this but if my projected date is longer than 14 days the report will not create a second page to continue until it has reached the projected end date. Below is a copy of the VBA code that I currently have:
Expand|Select|Wrap|Line Numbers
  1.  Sub Report_Load()
  2.  
  3.     Dim ColumnDate As Date
  4.     Dim ColumnNmbr As Integer
  5.  
  6.     ColumnDate = [Date_Issued]
  7.     ColumnNmbr = 1
  8.  
  9.     While ColumnDate <= Me.Projected_End_Date
  10.  
  11.       Select Case ColumnNmbr
  12.         Case 1
  13.           Me.Text148 = ColumnDate
  14.         Case 2
  15.           Me.Text150 = ColumnDate
  16.         Case 3
  17.           Me.Text151 = ColumnDate
  18.         Case 4
  19.           Me.Text152 = ColumnDate
  20.         Case 5
  21.           Me.Text153 = ColumnDate
  22.         Case 6
  23.           Me.Text154 = ColumnDate
  24.         Case 7
  25.           Me.Text155 = ColumnDate
  26.         Case 8
  27.           Me.Text301 = ColumnDate
  28.         Case 9
  29.           Me.Text302 = ColumnDate
  30.         Case 10
  31.           Me.Text303 = ColumnDate
  32.         Case 11
  33.           Me.Text304 = ColumnDate
  34.         Case 12
  35.           Me.Text305 = ColumnDate
  36.         Case 13
  37.           Me.Text306 = ColumnDate
  38.         Case 14
  39.           Me.Text307 = ColumnDate
  40.       End Select
  41.  
  42.       ColumnDate = DateAdd("d", 1, ColumnDate)
  43.       ColumnNmbr = ColumnNmbr + 1
  44.     Wend
  45. End Sub
  46.  
Dec 10 '20 #1
3 2494
twinnyfo
3,653 Expert Mod 2GB
CHaskett,

Welcome to Bytes!

It seems like your Report is designed fundamentally incorrectly.

You should have your dates listed and the Report simply lists those dates sequentially--no matter how many (few) dates you have.

What does the Table/Query behind this report look like?

Standing by to hepp!
Dec 10 '20 #2
twinnyfo,
The Query for the record source for the report is as follows:
Expand|Select|Wrap|Line Numbers
  1.  SELECT * FROM tblEquipLoanRecords WHERE [Tracking#] = ''; 
The table in which the report draws information from only has the date issued and the projected end date listed in it. I some how need to create a VBA code that will take the two dates in the table make a list of sequential dates in between the two dates, and then display all the dates within individual textboxes on the report. The dates will go into the top row of text boxes while the other row of text boxes will hold other information from the table. I am able to squeeze 14 textboxes in the top row, hence why if my projected end date is further out than 14 days the current VBA code will not list any date past the 14th day from the date issued. I need it to start with date issued and list every day between until the projected end date is reached then stop. I have tried Loops and If statements but i can never get the report to create a second page past the 14th textbox in the top row.
Dec 10 '20 #3
twinnyfo
3,653 Expert Mod 2GB
Sorry for my delay in response.....

1. First, it would be helpful for us to see a visual of what you have in mind. I think I kind of "get it." but a picture sometimes hepps. Maybe you can post either a pic of your current report (as displayed--so we know what types of information you are displaying)?

2. I do have some ideas on how to make such a query, but your description--if I understand it correctly--limits yourself to the size of the reporting capabilities in Access and is not data related. For example, a query can have as many as 255 output fields, but I don't know any report that could possibly fit 255 fields wide on any one sheet of paper (and Access reports are limited to 22x22 inches.

3. Along those lines, what is the maximum possible number of dates you would ever deal with? This is actually where you might want to start. If you are talking about a year's worth of dates, then Access is incapable to performing such a task. However, if your output generally has 14 or fewer dates and one in one thousand records has 15, and fewer than that has 16 (and son on), then we must ask the utility of covering all possible outcomes.

Obviously, I can't answer such questions, so I toss it back to you for response.
Dec 15 '20 #4

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

Similar topics

1
by: Mike Wiseley | last post by:
I would like to be able to loop through all the report objects in the database and show the recordsource for each and every report, even if the report is not actively open. If I know in advance of...
1
by: Andrew Parsons | last post by:
Apologies if this is an old chestnut, but I can't find an answer anywhere! I have a form which has a button which opens a report. This all works perfectly well. However, I am trying to set up a...
0
by: Robin | last post by:
I have designed a database but need help to find the code to link data by date/time as follows Times data entered at different parts of the process (Network) Product 1 Start Date/Time...
1
by: Li Pang | last post by:
Hi, I am new to start crystal report programming. Is there someone can help me: 1. The requirement of design (VS 2002 or VS 2003). 2. The requirement of execution (.Net 1.0 or .Net 1.1) 3....
3
by: Klint Gore | last post by:
Does anyone know of a mailing list for application developers using postgres? It'd probably be more relevant than pgsql-general for my question. Failing that, what do people use to generate...
18
by: dfetrow410 | last post by:
Anyone have some code that will do this? Dave
1
by: lottaviano | last post by:
My table lists pieces of equipment and the date/time they are taken down for maintenance, and date/time maintenance is complete (put back up to production). Sometimes these dates/times are within...
1
by: John | last post by:
Hi I have a list which the user can multi-select. My question is, how do I take the selected list items across to a report as data source? Thanks Regards
1
by: pitfour.ferguson | last post by:
My dbase has the start date and end date of each visit. How can I ask Access to list the day of the week of the start (easy), end (easy) and, more importantly, the dates of the visit itself - ie...
12
by: micarl | last post by:
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.