Error 2448

BillBee

Registered User.
Local time
, 17:07
Joined
Aug 31, 2008
Messages
137
I have viewed other threads but these do not help. I click on a control to open a Form and receive the message Runtime error 2448 "You cannot assign a value to this object" When I click on Debug in the MS VB screen it shows the following
Private Sub Form_Current()
Dim IngTemp As Long
IngTemp = Year(Date)
Forms![frmExhibitorEntry]![ThisYear] = IngTemp
End Sub
The third line in the code is highlighted. I do not have a good knowledge of VB Code and cannot see how this is connected to the opening of the Form. Any help would be appreciated.:banghead:
 
Because it says Object, what kind of control is ThisYear? Label? Textbox?
 
My guess on that error is that you have a control named ThisYear and its control source is calculated. Therefore you cannot assign a value to it.
 
The control is a Text Box. I have a Form that when opened among other things has a combo box with a dropdown list of peoples names. When I select a name from the list the current year is assigned to the field 'ThisYear'. This field is then used to select the people required from those who have not made entries for the current year. Hope this makes sense!
 
See post #3, the textbox has some Expression in it, eg.

=Year(Date())

So remove the expression.
Use the AfterUpdate of the list to set the value of the textbix.
 
Is frmExhibitorEntry open when you run the code? You can only access controls on a form when it is open.
 
Thanks to those who replied. Problem has been solved. Lot of errors occured in design view of Queries where in the field line each field name was preceded with exp. Recently installed office into new computer and was having other issues so decided to uninstall and reinstall the program and now issues so far have not reappeared. Thanks again
 

Users who are viewing this thread

Back
Top Bottom