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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Question 1

Status
Not open for further replies.

avagodro

Technical User
Aug 12, 2005
83
US
I have a a database that I input data from on a monthly basis, by the day that the item was logged.
The log sheet is currently an Excel spreadsheet but would like to run it in Access. What I need to be able to do is select the month the log is for (which is the easy part). There will also be a textbox in the details section that I want to have incrementally progress until the last day of the month. It would look similar to this:

Report Title

1/1/06 ________________
1/2/06 ________________
1/3/06 ________________
1/4/06 ________________
1/5/06 ________________
etc

Is there a way to have a report run such as this? I figure that there should be but am at a loss.
 
avagodro
Take a look at Sorting and Grouping in the report. There you can Sort and Group by your Date field.

Tom
 
avagodro,
You haven't really described your data. Do you have records for the report or are you creating a data entry type paper form for future records?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
That is not what I need to do. The dates, at this point, are not stored in a table. This would simply be a "log" to input data on that would be printed out.
I want to be able to select the month, say January, and the report could create the report from 1/1 to 1/31
 
it would be a data entry type paper form for future records
 
Create a blank report with NO record source. Add code to the On Page event of the report like:
Code:
Private Sub Report_Page()
    Dim datStart As Date
    Dim intTextLeft As Integer
    Dim intLineLeft As Integer
    Dim intLineLen As Integer
    Dim intVSpace As Integer
    intTextLeft = 200
    intLineLeft = 1200
    intLineLen = 2000
    intVSpace = 400
    datStart = CDate(InputBox("Enter Start Date", _
            "Enter Start", Format(Date, "mm/dd/yyyy")))
    datStart = DateSerial(Year(datStart), _
            Month(datStart), 1)
    intMonth = Month(datStart)
    Do Until Month(datStart) <> intMonth
        CurrentY = Day(datStart) * intVSpace
        CurrentX = intTextLeft
        Me.Print Format(datStart, "mm/dd/yyyy")
        Me.Line (intLineLeft, CurrentY)-Step(intLineLen, 0)
        datStart = datStart + 1
    Loop
End Sub

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
This somewhat works, but what I was looking for is I have a Text Box (txtDate) that I would like to have a formula placed in.
I would like to simply enter the month that I wanted, such as 1 for January. In the text box it would fill in for every day in the month of January (1/1/06, 1/2/06, 1/3/06, etc).
Any suggestions?
 
You could create a table of numbers with a single numeric field (tblNums.Num) and add values 1 through 31.

Create a query based on this table to use as the record source for your report:

SELECT DateSerial(Year(Date()),[Enter Mth Number],[Num]) AS TheDate
FROM tblNums
WHERE Month(DateSerial(Year(Date()),[Enter Mth Number],[Num]))=[Enter Mth Number];


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top