G
Guest
I have a form with a button that will preview a report based on the selection
of the form. On the report, there are 2 relevant fields: ProductionDate &
FactoryDeliveryDate. Both of them are date fields. Also on the form, there is
a text field for user to enter a date, called txtDate.
OK, here's what I need to do. I need to generate a report where the
ProductionDate is null where FactoryDeliveryDate + 3 weeks => txtDate.
The button that opens the report in the On Click event looks something like
this:
Dim stDocName1 As String
Dim strWhere As String
strWhere = "[lngCustNo]=" & Me.cboCust And DateAdd("ww", 3,
FactoryDeliveryDate) => Me.txtDate
stDocName = "Report1"
DoCmd.OpenReport stDocName, acPreview, , strWhere
I knew it was a long shot and as expected, it didn't work (type mismatch
error or something like this). Anyone can help if this is the right way to do
this? Thanks.
ck
of the form. On the report, there are 2 relevant fields: ProductionDate &
FactoryDeliveryDate. Both of them are date fields. Also on the form, there is
a text field for user to enter a date, called txtDate.
OK, here's what I need to do. I need to generate a report where the
ProductionDate is null where FactoryDeliveryDate + 3 weeks => txtDate.
The button that opens the report in the On Click event looks something like
this:
Dim stDocName1 As String
Dim strWhere As String
strWhere = "[lngCustNo]=" & Me.cboCust And DateAdd("ww", 3,
FactoryDeliveryDate) => Me.txtDate
stDocName = "Report1"
DoCmd.OpenReport stDocName, acPreview, , strWhere
I knew it was a long shot and as expected, it didn't work (type mismatch
error or something like this). Anyone can help if this is the right way to do
this? Thanks.
ck