error 2105, im really stuck

ice-9

Registered User.
Local time
Today, 00:58
Joined
May 21, 2004
Messages
88
Hi,

Ive never been stuck this much.
i dont know what else to do.
The problem is, i use the DoCmd.GoToRecord , , acNewRec to add a new record. It used to work fine, but to day, i keep getting the error 2105, Cannot go to secified record.

i dont know why, and i dont know what else to do.
this is my code atm.

Code:
Private Sub Knop26_Click()
Dim strFull, strLastNumber, strLastRecord As String
Dim strFirstNumber As String
   Dim strRest As String
   Dim x   As Integer
   Dim cn As ADODB.Connection
   Set cn = CurrentProject.Connection
   Dim rs As Recordset
   Set rs = Me.MinutesListSF.Form.RecordsetClone
   Forms!MinutesMFnew!MinutesSF.SetFocus
       
     strFull = (Forms!MinutesMFnew!MinutesSF!MinutesID)
   If Me.MinutesListSF.Form.RecordsetClone.RecordCount > 0 Then
      rs.MoveLast
      strLastRecord = rs!MinutesID
      strLastRecord = GetFirstNumber(strLastRecord)
      DoCmd.GoToRecord , , acNewRec
Else
      DoCmd.GoToRecord , , acNewRec
      Forms!MinutesMFnew!MinutesSF!MinutesID = "    1"
  End If
   
        Forms!MinutesMFnew!MinutesSF!MinutesID = "    " & strLastRecord
      Forms!MinutesMFnew!MinutesSF!MinutesTitle = ""
   Forms!MinutesMFnew!MinutesSF!AreaCode = ""
   Forms!MinutesMFnew!MinutesSF!OldMinuteID = ""
   ' Forms!MinutesMFnew!MinutesSF!EmployeeCode_followup = ""
   Forms!MinutesMFnew!MinutesSF!SubjectCode = ""
   Forms!MinutesMFnew!MinutesSF!Combo15 = Forms!MinutesMFnew!ComboMeetingNav
   DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
   Me.MinutesListSF.Requery
   sort
   Me.MinutesListSF.Requery
   rs.Close
   Set rs = Nothing
 
instant update.

The form has a few objects.
now comes the weird part.
WHen i select one, en press the button, by some controls he gives me the error, with other controls it doesnt. Always the same controls where it does or doesnt work!
 
It looks like that every control that has an event, gives error. For example on exit or onclick. When i remove the event form the SF it does work.
 

Users who are viewing this thread

Back
Top Bottom