Can't assign Value to this object (1 Viewer)

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
Thanks arnelgp. I've spent most of today trying to trim it back to a bare minimum - to demo the problem. It's still 4 MB after compacting.
I will try and make it smaller. Is there a size limit to an attachment here?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:00
Joined
May 7, 2009
Messages
19,231
just leave 2 records from your table with notes/memo. include the form and subform and the edit form. compact and repair. then Zip your db and upload the Zip file.
 

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
Understood... but as I was trimming it further just now , I tested for the problem and it has gone. So I'll start over and try to pinpoint what /when it comes right.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 14:00
Joined
Sep 12, 2006
Messages
15,634
Could not update; currently locked by another session on this machine.".

This is not to do with the ldb file

if you have two forms open, with the same record and you try to save one, you will see a message something like "another user has edited your record", when in fact YOU YOURSELF are the other user.

One way to see this is to add record selectors to your forms. a dirty/edited record will show a pencil in the record selector bar to the left of the detail area.


Are you actually using RECORD LOCKING in your database? - your error message is different to the one I mentioned above, which is what you get with no record locking (optimistic record locking). If so, I would think carefully whether you do need record locking, as it can add more complications than it solves.
 

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
I'm not sure if I have Record Locking. Most likely it's whatever the default is. I haven't got Record selectors on the edit Form as it looks at just one Record. This Form seems okay as both the original and cut back work. The problem must be something removed from somewhere else.

There is a record selected on the main form, then the edit Form opens to this record. This usually save changes but it's not consistent .
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:00
Joined
Feb 28, 2001
Messages
27,131
There is a record selected on the main form, then the edit Form opens to this record.

That is two references to the same record at the same time, and forms usually are opened in an update mode. Then your edit will do the same. That is your conflict.
 

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
You're probably spot on, but I haven't found it yet. In its cut down form it is working mostly as beforehand with only *some* records failing. I don't understand that so it'll be interesting to find out exactly what's going on.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:00
Joined
May 7, 2009
Messages
19,231
you uoload your db with the form and the form for eding even with no records on the table and well just add one.
 

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
At the moment the demo works so there would be nothing to show you.
I now have the demo and original on 2 different computers and hope to step through each and detect where one errors and the other doesn't.
That's my plan, but I've struck an unrelated problem.
Error 429 Active-X component can't create Object
Code:
Set clsMouseWheel = New MouseWheel.CMouseWheel
After looking further I find although "MouseWheel.dll" is in the Windows/System32 folder, browsing to it from Access will not find it. Likewise Running REGSVR also fails to find it.
Is this somethingt to do with 64 bit ? (Windows on this machine is 64 bit)
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:00
Joined
May 7, 2009
Messages
19,231
i don't see any mousewheel.dll on windows 10 x64.
you have to copy it from the computer that has it.
put both on system32 and syswow64.
then run regsvr (the 64 version) from syswow64.
 

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
I could not (tried for ages) to reg the DLL but it just would not work in the \System32 folder. So I put in on the desktop and then all was okay.
But I've had no luck with the bug... cannot see where/how it is happening and that some (most) things edit without it happening doesn't help.

The error occurs when you close the edit Form, but there is no way to step and see it ocurring -or is there ?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:00
Joined
May 7, 2009
Messages
19,231
is the edit form, editing only the memo?
I am also using an edit form on my other db.
 

Attachments

  • editForm.zip
    46.7 KB · Views: 72
Last edited:

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
I will have a look. But the answer is both Yes and No, as I have a second Form which also has the same problem... and is just this code

Code:
Private Sub Form_Load()
    Me.Caption = Nz(Me.OpenArgs)
    If Me.Caption > "" Then
        Me.RecordSource = "Select * from qryBB Where Prefix = '" & Me.Caption & "'"
        Me.Text2 = Replace(Me.Text0, vbLf, vbCrLf)
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If Nz(Me.Caption) > "" Then
        Me.Text0 = Replace(Me.Text2, vbCrLf, vbLf)
    End If
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:00
Joined
May 7, 2009
Messages
19,231
you should use "<>" for comparing strings.
 

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
Ok Arneglp, I'll change to <>. Still debugging here... will get it eventually. Your edit form is a bit different still comparing. Thanks...
 

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
Ah gee, Access makes it hard to win sometimes. I exported my (bad) frmMain to a folder, and did the same with a (potentially good) frmMain from Comp 2.
Now I find I cannot Import the good one OR the same one I exported.

The module name 'Form_frmMain' is invalid.
* The module name may start with the prefix Form_ or Report_.
* The module can't be named Forms, Reports, Modules, Application, Screen, Assistant, CommandBars, References, or DoCmd.
* The module name may have too many characters.

Help ! Please tell me there is some way round this. Although it does start with Form_ that is what it gave it when exported.
 

isladogs

MVP / VIP
Local time
Today, 14:00
Joined
Jan 14, 2017
Messages
18,209
The form should be called frmMain in the navigation pane. The prefix Form_ is automatically applied in the VBE by Access for identification purposes so should not be used by you to name the object.
 

kirkm

Registered User.
Local time
Tomorrow, 01:00
Joined
Oct 30, 2008
Messages
1,257
I never called it Form_frmMain ever. Access did that. How do I get (import) the Form back into Access? Whether it's called "Form_frmMain" or just "frmMain" still gives the same error message. It's a really big Form and I don't want to rebuild it
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 14:00
Joined
Sep 12, 2006
Messages
15,634
if you temporarily add record selectors to your forms (even if there is only one record) the record selector triangle/arrow will change to a different symbol indicating the status of the record.

it's worth doing this until you debug this. If it changes to a pencil, you probably have optimistic/no record locking. If it changes to something else, you have a an active pessimistic record locking. In any event, it will clearly demonstrate the problem, as no doubt both forms will show an edited record.
 

isladogs

MVP / VIP
Local time
Today, 14:00
Joined
Jan 14, 2017
Messages
18,209
I never called it Form_frmMain ever. Access did that. How do I get (import) the Form back into Access? Whether it's called "Form_frmMain" or just "frmMain" still gives the same error message. It's a really big Form and I don't want to rebuild it

I've never had this issue in 20 years of using Access.
Open the database you want to import the form into, click External Data, Import … from Access, select the source database and then Import. Select your form and it should be imported with the original name. If a form exists with that name already, Access will add a 1 suffix to distinguish them.
If that goes wrong you may have corruption in a system table MSysObjects.
If so, come back for further advice
 

Users who are viewing this thread

Top Bottom