Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error 2448 2

Status
Not open for further replies.

dmeyring

Technical User
Nov 15, 2006
22
US
I have a 20 user split database that is experiencing a problem with a line of code that previously worked well. The line appeared to be working, but since more users have been added it is triggering this error message when the form is opened:
Run-time error '2448': You can't assign a value to this object.

When I debug, the line of code that is throwing the error is:
Code:
Private Sub lstSLAdesc_AfterUpdate()
'updates the value of SLAnum field  - qrySLAreason runs off from this info
    [b][COLOR=red]Me!txtSLAnum.Value = lstSLAdesc.Column(1)[/color][/b]
    Me.lstSLAreason.Requery
End Sub

I've tried calling this line from Form Open, Load and Current and all come up with the same error. The aim of this piece of code is to keep the selected value showing in a list box (lstSLAreason) which is dependent on the selection from the first list box (lstSLAdesc).

I don't understand why this error is happening, any direction is greatly appreciated!
Thank you!
 
Usually this happens when trying to set the value to null. How about
Code:
Me!txtSLAnum.Value = Nz(lstSLAdesc.Column(1),"")
?

Sure, the early bird gets the worm, but the second mouse gets the cheese in the trap.
 
How are ya dmeyring . . .

You qualify [blue]txtSLAnum[/blue] with the form reference [blue]Me[/blue], but do not do the same with [blue]lstSLAdesc![/blue].

Understand, when you do this Access doesn't know if its a control, variable, object or what . . . and goes on a hunt to try and find out. No telling the results in this case, but if it worked . . . [blue]you simply lucked out![/blue]

So your 1st immediate change should be:
Code:
[blue]
Change:
   lstSLAdesc
To:
 Me!lstSLAdesc[/blue]
I don't know if this will fix the problem, but as far as forms are concerned, always perfix the control with the proper form reference . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Doh! Thanks AceMan & genomon! I'm testing out both solutions starting with correcting the ME. Unfortunately my error is a bit slippery and doesn't consistently occur, but thank you both for the place to start!
 
Rut-row...deployed the fixes discussed above to all of my users yesterday, but we are still getting the same 2448 error message. The database is split, but could this still be some sort of multiple-user conflict? anything relating to the network set-up of my users?

stumped :(
 
You're not running Access 2003 with that new bomb from Micro$oft, SP3 , are you?

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
. . . and what happens when you compile? . . . or is your code already in a compiled state?

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
hi Missinglinq, no on the SP3 for myself and the rest of the users...

hi Aceman, the error doesn't pop up when I compile, and then I save the code in the compiled state before distributing to the users.

The error does not happen consistently, but I tend to see it when someone has had the front-end opn on their pc for some time (a few hours maybe) and then another user tries to open their front-end. The second user then receives the error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top