I am trying to assign a value to a textbox in the footer of my report. I am trying to assign a global variable to the textbox, to display in the footer. Here is some sample code where i try to hard code a value into a textbox.
txtHours.SetFocus
txtHours.Text = "43"
However, when I try to program this code withoutusing the SetFocus statement, I receive an error that says "you cannot reference a property or method for a control that doesn't have the focus". However once I set the focus using code I receive this error, "Microsoft access does not allow you to use this method in the current view". I am trying to put my code in the Open event of the form. Does anyone know why I receive these errors. Also, is there any way to assign a value to a textbox in an Access report? Thank you for your time and help
txtHours.SetFocus
txtHours.Text = "43"
However, when I try to program this code withoutusing the SetFocus statement, I receive an error that says "you cannot reference a property or method for a control that doesn't have the focus". However once I set the focus using code I receive this error, "Microsoft access does not allow you to use this method in the current view". I am trying to put my code in the Open event of the form. Does anyone know why I receive these errors. Also, is there any way to assign a value to a textbox in an Access report? Thank you for your time and help