Report selected by year

  • Thread starter Thread starter tspies85 via AccessMonster.com
  • Start date Start date
T

tspies85 via AccessMonster.com

Hi,
Can i do this?
create a combo box..consist of year(2000,2001,2003..)
i want the report to be displayed according to year that the user selected
before open a report view.( i hope to make the combo box just like pop up
message.How am i going to do this?..many thanks..
 
Assuming a form "frmRptSlct" with a combo box "cboYear" and a report with a
field containing a year value "FieldYear"...
Add a command button to the form with code like:

Dim strWhere as String
strWhere = "1=1 "
If Not IsNull(Me.cboYear) Then
strWhere = strWhere & " And [FieldYear] = " & Me.cboYear
End If
DoCmd.OpenReport "rptNoName", acPreview, , strWhere
 
Hi Duane,
How can the cboYear (or the code) can recognize and select the details about
all the record within the year selected?
I don't really understand the flow...sorry.. can you clarify a little...
thanks

Duane said:
Assuming a form "frmRptSlct" with a combo box "cboYear" and a report with a
field containing a year value "FieldYear"...
Add a command button to the form with code like:

Dim strWhere as String
strWhere = "1=1 "
If Not IsNull(Me.cboYear) Then
strWhere = strWhere & " And [FieldYear] = " & Me.cboYear
End If
DoCmd.OpenReport "rptNoName", acPreview, , strWhere
Hi,
Can i do this?
[quoted text clipped - 3 lines]
before open a report view.( i hope to make the combo box just like pop up
message.How am i going to do this?..many thanks..
 
Reply in your more recent thread. You should just be patient and stick in
one thread with one question.

--
Duane Hookom
MS Access MVP

tspies85 via AccessMonster.com said:
Hi Duane,
How can the cboYear (or the code) can recognize and select the details
about
all the record within the year selected?
I don't really understand the flow...sorry.. can you clarify a little...
thanks

Duane said:
Assuming a form "frmRptSlct" with a combo box "cboYear" and a report with
a
field containing a year value "FieldYear"...
Add a command button to the form with code like:

Dim strWhere as String
strWhere = "1=1 "
If Not IsNull(Me.cboYear) Then
strWhere = strWhere & " And [FieldYear] = " & Me.cboYear
End If
DoCmd.OpenReport "rptNoName", acPreview, , strWhere
Hi,
Can i do this?
[quoted text clipped - 3 lines]
before open a report view.( i hope to make the combo box just like pop
up
message.How am i going to do this?..many thanks..
 
Back
Top