there is a query called "My Query" which is dynamic
this query is based on a table ..
in this table i change the caption on fields.
when i run the query i have "field names" the caption i was set.
i made then a code to open the report...which is also dynamic ..
this is the code i found
Dim stDocName As String
Dim accobj As AccessObject
On Error GoTo Err_Command100_Click
stDocName = "MY QUERY"
Set accobj = Application.CurrentProject.AllReports.Item(stDocName)
If accobj.IsLoaded Then
If accobj.CurrentView = acCurViewPreview Then
DoCmd.Close acReport, stDocName
DoCmd.OpenReport stDocName, acPreview
End If
Else
DoCmd.OpenReport stDocName, acPreview
End If
the problem is that in the report i did not have the caption i was set but the initial field name...how can i change it...
thank you
this query is based on a table ..
in this table i change the caption on fields.
when i run the query i have "field names" the caption i was set.
i made then a code to open the report...which is also dynamic ..
this is the code i found
Dim stDocName As String
Dim accobj As AccessObject
On Error GoTo Err_Command100_Click
stDocName = "MY QUERY"
Set accobj = Application.CurrentProject.AllReports.Item(stDocName)
If accobj.IsLoaded Then
If accobj.CurrentView = acCurViewPreview Then
DoCmd.Close acReport, stDocName
DoCmd.OpenReport stDocName, acPreview
End If
Else
DoCmd.OpenReport stDocName, acPreview
End If
the problem is that in the report i did not have the caption i was set but the initial field name...how can i change it...
thank you
Last edited: