Hi,
I have what should be a simple problem to fix but i cannot find the solution anywhere. I have a form that is used to release a list of production orders. On the form I have two critical peices of criteria that i need to use to open a report with focus. The feild names and data types are as follows:
DateRlsd - Date/time
PrimDept - Text
I am running the report from a query and under each of the columns for the two feilds above I have the following criteria specified:
[Forms]![frmSchedule_build]![DateRlsd]
[Forms]![frmSchedule_build]![PrimDept]
The code that i have to run the report is as follows. The code is set to enter the DateRlsd based on an unbound text box I have where you type the date. It loops through all teh records displayed on the form and then prints the report. The problem is that the report is blank.
Private Sub cmdAddDate_Click()
On Error GoTo Err_End
If IsDate(rlsedate) Then
DoCmd.GoToRecord , , acFirst
Me.[DateRlsd] = [rlsedate]
DoCmd.Save
Next_Record:
DoCmd.GoToRecord , , acNext
Me.[DateRlsd] = [rlsedate]
DoCmd.Save
GoTo Next_Record
Else
MsgBox "Require a date in the date box"
End If
Exit Sub
Err_End:
Me.Dirty = False
DoCmd.OpenReport "rptJournal", acViewNormal
End Sub
I have what should be a simple problem to fix but i cannot find the solution anywhere. I have a form that is used to release a list of production orders. On the form I have two critical peices of criteria that i need to use to open a report with focus. The feild names and data types are as follows:
DateRlsd - Date/time
PrimDept - Text
I am running the report from a query and under each of the columns for the two feilds above I have the following criteria specified:
[Forms]![frmSchedule_build]![DateRlsd]
[Forms]![frmSchedule_build]![PrimDept]
The code that i have to run the report is as follows. The code is set to enter the DateRlsd based on an unbound text box I have where you type the date. It loops through all teh records displayed on the form and then prints the report. The problem is that the report is blank.
Private Sub cmdAddDate_Click()
On Error GoTo Err_End
If IsDate(rlsedate) Then
DoCmd.GoToRecord , , acFirst
Me.[DateRlsd] = [rlsedate]
DoCmd.Save
Next_Record:
DoCmd.GoToRecord , , acNext
Me.[DateRlsd] = [rlsedate]
DoCmd.Save
GoTo Next_Record
Else
MsgBox "Require a date in the date box"
End If
Exit Sub
Err_End:
Me.Dirty = False
DoCmd.OpenReport "rptJournal", acViewNormal
End Sub