
July 28th, 2004, 06:33 AM
|
|
Contributing User
|
|
Join Date: Jul 2004
Posts: 65
Time spent in forums: 37 m 32 sec
Reputation Power: 5
|
|
|
Referencing fields on a subform
Please can anyone help? When I run the following piece of code it asks me to enter the fields referred to, as if it expects a parameter. Why does it not recognise the subform's fields?
The subform is not loaded at the time of running, but I have tried to load it and it doesn't recognise the Load command either.
Private Sub Command191_Click()
'Process runs when 'Report Print Preview' button pressed
Dim stdoc3, stlc4, stdatenew2, stld4 As String
stdoc3 = "OverdueRecommendations"
stdatenew2 = "Forms![Subform Recommendations]![Timescale] < date()"
stlc4 = "[Forms]![subform Recommendations]![Date Completed] is null" & " And " & "[Forms]![subform Recommendations]![Timescale] is not null"
stld4 = stlc4 & " And " & stdatenew2
If [report to print] = 14 And IsNull(Me![date1]) Then DoCmd.OpenReport stdoc3, acPreview, , stld4
End If
End Sub
|