Share via

OPENING MS ACCESS REPORT BASED ON DATES

AMOS OSWOM 21 Reputation points
2022-08-08T07:15:22.83+00:00

Hello am trying opening a report from a form based on the current record selected which is a date but it cant display the specified DATE record it only diplays all dates please help me with this.....?

THIS FORMULAR WORK WITH OTHER RECODE'S BUT NOT DATES
WHERE CONDITION: ="DATE_PAID=" & [DATE_PAID]
OR
VISUAL BASIC: DoCmd.OpenReport "TUTION_R", acViewPreview, , , , "DATE_PAID = " & Me.DATE_PAID

Microsoft 365 and Office | Access | Development
0 comments No comments

Answer accepted by question author

Ken Sheridan 3,571 Reputation points
2022-08-08T11:29:08.467+00:00

Merely delimiting the value of the control with hash characters will not work if your system short date format is not in US format. To ensure international consistency it is best to format the value in US format or an internationally unambiguous format such as the ISO standard for date notation of YYYY-MM-DD:

DoCmd.OpenReport "TUTION_R", acViewPreview, , , , "DATE_PAID = #" & Format(Me.DATE_PAID,"yyyy-mm-dd") & "#"

Another thing which might cause the report not to return the record is if the date/time values in the report include non-zero time of day elements. This might not be readily apparent from the data. If a column is only to include date values (i.e. with a zero time of day element) this should be enforced by a ValidationRule which only allows integer values. Any existing values can be corrected with an UPDATE query which updates the column to Int(Date_Paid).

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. xps350 381 Reputation points
    2022-08-08T10:45:49.213+00:00

    Try:
    VISUAL BASIC: DoCmd.OpenReport "TUTION_R", acViewPreview, , , , "DATE_PAID = #" & Me.DATE_PAID & "#"

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.