run-time error 2105

Can't you see the error 2105 in the file that I have uploaded when opening form 'frmClientsExtra' or 'frmClientsNew'?

I'm not sure if anybody can replicate the error. Probably not. To my experience, it seems strange and I never came across this error in this particular situation.
That is why I have shared the file so others can experience it and eventually come up with a reason for the error. Once we got the reason the solution is easy.

You are right about the datasheet. Once removed (convert the split form into a single form) the error disappears. So it seems that there is a synchronization problem or better I think that this is a Trust issue. For some reason Access do not Trust the datasheet side of the form and opens the RowSource in Disable mode (as it does when there is a Trust violation), therefore not allowing any executable code to run hence the error 2105 on the GoTo line and if this line is commented out then the error 2950: Reserved Error on the setFocus line.

If this is so, my question is: How did this happen?

I have rebuilt the frmClientsNew from scratch and works fine. I copied the VBA code from the old form to the new. it works well. I had a demo today with the client and everything went smooth.

Split Forms have worked fine for me so far. all other forms are split forms and they work well. Besides this issue I see no reason to avoid them. They give the client an 'Excel' kind of feeling and they seem to like it as, I think, they see something similar to what they are used and the 'fear' the database 'monster' eases out... :)
 
I couldn't replicate the error you are experiencing (and I don't recall seeing any evidence that anybody else here could either.)

I got the advertised error with frmClientsNew. Didn't look at the others.
 
Had another look on a different PC and got the error.

Making sure the fields aren't locked seems to fix it, but on this PC all of the buttons are locked until I click into the datagrid so the cmdClose.setfocus causes another error. :banghead:

I think I swapped lNewStart around so you'll need to fix it how you want it.

Code:
Private Sub Form_Load()
    
    lockUnlockFields lNewStart
    
    If lNewStart Then
        DoCmd.GoToRecord , , acNewRec
    Else
        lNewStart = False
    End If
    
    'Me.cmdClose.SetFocus

End Sub
 
Hi guys

I have been away for a couple of weeks.

The application is now delivered to the client. It seemed that the problem was related to the fact that the fields were disabled at Form start-up and for some reason Access couldn't deal with it. The error could be replicated by hiding a field in the datasheet and then when the form was loaded the 2105 error will pop-up. However if I unhide the same field, the error will go away.

The work around was to have all fields enabled in the form and the only disable them at the end of Form_Load().

It worked well and stable.

Thank you all for you help. This thread is now closed.

Regards
Luis
 

Users who are viewing this thread

Back
Top Bottom