By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,761 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

Error 2448 - But I dont see why?

P: 31
Hi all,

I have been banging my head against the wall with this one for a while so I now turn to you all for a pointer.

I am currently having trouble with error 2448 “You can't assign a value to this object”.

It is driving me mad as I cant see why it wont let me assign a value.

Overview:

On the main form I have a combo box which allows the user to select which project they are on. They can then enter info into a subform within the main form. Each of the entry’s needs to be married to the selected project, I used:

If IsNull(Me.TravelDate1) Then ‘check if there is any data
Exit Sub
Else
Me.TravelProjectNo1 = NewProjectNo ‘update project No
End If

(NewProjectNo is a public string)

This is when it all goes south. If I enter data into a new record its works perfectly. If I attempt to modify info on the subsheet and update the record (needed before a print/preview) it informs me that TravelProjectNo1 cannot have a value assigned to it (error 2448). In debug, if I force it to continue, it assigns a value to the object despite what it says??

Better still if I don’t modify any data in the subform but I select a different project from the combo box and update, it updates without complaint??

Any help is most welcome as I am at a complete loss!
Nov 27 '06 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,660
You can set it to an existing value in the list I believe.
Otherwise it will complain. Only ListBoxes have the option of allowing the operator to select an item not already in the list.
If you add a record to the underlying (bound) dataset, then you need to requery the ComboBox before accessing it.
Nov 27 '06 #2

P: 31
Cheers NeoPa,

Will give that a try!
Nov 28 '06 #3

NeoPa
Expert Mod 15k+
P: 31,660
No problem.
Hope it works for you.
Nov 29 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.