Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / July 2007

Tip: Looking for answers? Try searching our database.

Why I am getting the ERROR 2105?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chipcom - 24 Jul 2007 23:14 GMT
Hi

I am getting error 2105 and I don't know why (There are no null
fields).
I use the code:

On Error GoTo Error_Handler
Dim db As DAO.Database
Dim rst As DAO.Recordset

     Set db = CurrentDb
     Set rst = db.OpenRecordset("tblWhatever", dbOpenDynaset)

     With rst
         .AddNew
         !WhateverID = Me.txtWhateverID
         !FirstName = Me.txtFName
         !LastName = Me.txtLName
          .Update
      End With

Exit_Here:
       rst.Close
       Set rst = Nothing
       Set db = Nothing
Exit Sub

Error_Handler:
       MsgBox Err.Number
       Resume Exit_Here

Any idea why?

Thanks
Scott McDaniel - 25 Jul 2007 00:37 GMT
>Hi
>
>I am getting error 2105 and I don't know why (There are no null
>fields).
>I use the code:

2105 is, if I'm not mistaken, "You can't go to the specified record" ... if that's the error you're gettings, then are
you sure that you (or someone else) doesn't have this table open?

>On Error GoTo Error_Handler
>Dim db As DAO.Database
[quoted text clipped - 24 lines]
>
>Thanks

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
Chipcom - 25 Jul 2007 04:55 GMT
On Jul 25, 2:37 am, Scott McDaniel <scott@NoSpam_Infotrakker.com>
wrote:
> >Hi
>
[quoted text clipped - 38 lines]
>
> - Show quoted text -

Hi

I don't know what you mean by table open but I now that the record is
saved in the table and for now I am the only one who use the table.
Gina Whipp - 25 Jul 2007 05:36 GMT
A couple thoughts...

!WhateverID = Me.txtWhateverID <-- Are you trying to duplicate a primary
key?

And according to Allen Browne's code this appears to be missing a line

         !LastName = Me.txtLName
          .Update
          .Bookmark = .LastModified  <---- missing line
      End With

Signature

Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

> On Jul 25, 2:37 am, Scott McDaniel <scott@NoSpam_Infotrakker.com>
> wrote:
[quoted text clipped - 46 lines]
> I don't know what you mean by table open but I now that the record is
> saved in the table and for now I am the only one who use the table.
Chipcom - 29 Jul 2007 05:15 GMT
> A couple thoughts...
>
[quoted text clipped - 65 lines]
>
> - Show quoted text -

Hi

Your segestion didn't help to solve the problem.
Do you have any idea how to solve the problem ?
I use the Immediate window and it didn't show me error 2105, just when
it reach the line :
MsgBox Err.Number
I know that I have this error.
>From other sub that run the line:
DoCmd.GoToRecord acDataForm, "PaycheckTable", acNewRec
Gina Whipp - 29 Jul 2007 05:33 GMT
Can you post the entire code as you have it now?  Telling me my segment
didn't work doesn't really help me.  Also can you share with us exactly what
you are trying to do?

Signature

Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

>> A couple thoughts...
>>
[quoted text clipped - 79 lines]
>>From other sub that run the line:
> DoCmd.GoToRecord acDataForm, "PaycheckTable", acNewRec
Chipcom - 29 Jul 2007 22:51 GMT
> Can you post the entire code as you have it now?  Telling me my segment
> didn't work doesn't really help me.  Also can you share with us exactly what
[quoted text clipped - 93 lines]
>
> - Show quoted text -

Hi

The user needs to enter the user name and the password so it inserts
into the database. After that a reference number is created.
Here is the code:

Private Sub Form_BeforeUpdate(Cancel As Integer)

On Error GoTo Error_Handler
Dim db As DAO.Database
Dim rst As DAO.Recordset

     Set db = CurrentDb
     Set rst = db.OpenRecordset("tblWhatever", dbOpenDynaset)

     With rst
         .AddNew
         !WhateverID = Me.txtWhateverID
         !FirstName = Me.txtFName
         !LastName = Me.txtLName
          .Update
          .Bookmark = .LastModified
      End With

Exit_Here:
       rst.Close
       Set rst = Nothing
       Set db = Nothing
Exit Sub

Error_Handler:
       MsgBox Err.Number
       Resume Exit_Here

Cancel = True
Exit Sub

Error_Handler:
    MsgBox Err.Number
  Resume Exit_Here

End Sub

Public Sub Form_KeyPress(KeyAscii As Integer)

  Dim Erro As Integer
   '13=Carriage Return
    If KeyAscii = 13 Then
On Error GoTo Err_Form_KeyPress

    DoCmd.GoToRecord acDataForm, "tblWhatever", acNewRec
Exit_Form_KeyPress:
   Exit Sub

Err_Form_KeyPress:
   MsgBox Err.Description
   MsgBox Err.Number
   Resume Exit_Form_KeyPress

  End If
Gina Whipp - 29 Jul 2007 23:26 GMT
And just so that I am clear...  you longer get the error 2105, you just know
you have it from other sub line...  Can you put a breakpoint on .Bookmark
line and see if the code runs to there?  Also, I would like to know how you
know you have this error since you said it no longer shows 2105?

>> > Your segestion didn't help to solve the problem.
>> > Do you have any idea how to solve the problem ?
[quoted text clipped - 4 lines]
>> >>From other sub that run the line:
>> > DoCmd.GoToRecord acDataForm, "PaycheckTable", acNewRec

Signature

Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

>> Can you post the entire code as you have it now?  Telling me my segment
>> didn't work doesn't really help me.  Also can you share with us exactly
[quoted text clipped - 161 lines]
>
>   End If
Scott McDaniel - 25 Jul 2007 15:48 GMT
>On Jul 25, 2:37 am, Scott McDaniel <scott@NoSpam_Infotrakker.com>
>wrote:
[quoted text clipped - 6 lines]
>> 2105 is, if I'm not mistaken, "You can't go to the specified record" ... if that's the error you're gettings, then are
>> you sure that you (or someone else) doesn't have this table open?

Can you pinpoint the line where the error occurs?

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.