J
John m
I am using Access 2007 for the first time after a fair amount of use of
previous Access versions pre 2003.
I am trying to change the contents of a text box in Access 2007 at the
format event of a report using the following:
***********
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
txtWeekDay.Text = "tested"
End Sub
*************
If I do this when running print review I get the followng error message:
"You can't reference a method or property for a control unless the control
has the focus"
If I then add to the code as follows
*********
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
txtWeekDay.SetFocus
txtWeekDay.Text = "tested"
End Sub
***********
I then get the error message:
"Microsoft access does not allow you to use this method in the current view"
I suppose I am missing something obvious but I cannot see it so I would be
most grateful for advice,
Best wishes, John Morgan
previous Access versions pre 2003.
I am trying to change the contents of a text box in Access 2007 at the
format event of a report using the following:
***********
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
txtWeekDay.Text = "tested"
End Sub
*************
If I do this when running print review I get the followng error message:
"You can't reference a method or property for a control unless the control
has the focus"
If I then add to the code as follows
*********
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
txtWeekDay.SetFocus
txtWeekDay.Text = "tested"
End Sub
***********
I then get the error message:
"Microsoft access does not allow you to use this method in the current view"
I suppose I am missing something obvious but I cannot see it so I would be
most grateful for advice,
Best wishes, John Morgan