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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACC: You can't go to the specified record. 2

Status
Not open for further replies.

MDGarcia

Programmer
Oct 7, 2004
64
PR
Hello everyone.

We migrated an Access database to Oracle. We're connecting through ODBC and it linked very well and it's opening forms without problem.

The issue comes when adding a new record. The message that comes up is <You can't go to the specified record.> I added additional VBA code behind the OnClick event and it looks like this:
Private Sub cmdAddPer_Click()
On Error GoTo Err_cmdAddPer_Click


DoCmd.GoToRecord , , acNewRec
bNewRec = True
Me.VACATIONS = 0
Me.SICKLEAVE = 0
Me.LUMPSUM = 0
Me.NAVAC = 0
Me.NASCK = 0
Me.NAREG = 0
Me.LS1 = Null
Me.LS2 = Null
Me.LS3 = Null
Me.SS.SetFocus
Exit_cmdAddPer_Click:
Exit Sub

Err_cmdAddPer_Click:
MsgBox Err.Description
Resume Exit_cmdAddPen_Click

End Sub

There is no primary key set up for this table.

Any suggestions?

Thank you.
 
From the above, it would seem that you do not have a recordset attached to the form, therefore there is no New Record to go to, nor is there any need as you are clearing the controls.
 
There is no primary key set up for this table
A linked table without PK is prone to strange behaviour in access ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hello all.

Thanks PHV, I confirmed my suspicions. I created and index primary key in Oracle and problem was solved.

Remou: You don't see a recordset because I make the user connect every time he logs on.

Thank you both.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top