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.

You cant go to specified record

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
deb - 30 Jul 2007 14:26 GMT
I have a form with an Add Record button.
When the button is clicked when first entering the form, I works great.
When the 1st record is entered and the button is clicked again to enter
another record, I get a msg "You cant go to specified record."  I click the
OK button and then...
I am able to click the Add Record button and it works.

Any suggestions?
Signature

deb

Wayne-I-M - 30 Jul 2007 15:00 GMT
Do you have the DataEntry set to = Yes

If so, change it to = No

Note this will stop you entering the form at a new record.  To continue
entering the form at a new record you would need to add some code to the
form's OnLoad event

Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
End Sub

Hope this helps, good luck

Signature

Wayne
Manchester, England.

> I have a form with an Add Record button.
> When the button is clicked when first entering the form, I works great.
[quoted text clipped - 4 lines]
>
> Any suggestions?
deb - 30 Jul 2007 15:28 GMT
Data entry is set to No

Tried..
Private Sub Form_Load()
> DoCmd.GoToRecord , , acNewRec
> End Sub

didn't help

I even put Me.AllowEdits = True
Me.AllowAdditions = True in the code.

It's making me crazy...

Signature

deb

> Do you have the DataEntry set to = Yes
>
[quoted text clipped - 18 lines]
> >
> > Any suggestions?
Wayne-I-M - 30 Jul 2007 15:54 GMT
Can you post the code behind the button you use to add new records

Signature

Wayne
Manchester, England.

> Data entry is set to No
>
[quoted text clipped - 32 lines]
> > >
> > > Any suggestions?
deb - 30 Jul 2007 16:04 GMT
Private Sub btnAddNew_Click()
On Error GoTo Err_btnAddNew_Click

Me.AllowEdits = True
Me.AllowAdditions = True

ProjID.SetFocus

DoCmd.SetWarnings False
' if current record report date is 1 then delete
  If Me.ReportDtID = 1 Then
  Me![Photo] = "none"
  Me![Page] = 999999999
   Me.Undo
   DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
   DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
   End If
DoCmd.SetWarnings True

   DoCmd.GoToRecord , , acNewRec

Exit_btnAddNew_Click:
   Exit Sub

Err_btnAddNew_Click:
   MsgBox Err.Description
   Resume Exit_btnAddNew_Click
Signature

deb

> Can you post the code behind the button you use to add new records
>
[quoted text clipped - 34 lines]
> > > >
> > > > Any suggestions?
Wayne-I-M - 30 Jul 2007 20:56 GMT
Hi

Sorry for not getting back to you sooner.

I noticed that you are adding and deleteing the new reocrd at the same time
so you will never be able to go to it unless you cancel the operation ??
(which is what seem to be happening.
  If Me.ReportDtID = 1 Then
   DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
   DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
   End If
   DoCmd.GoToRecord , , acNewRec

eg.  If something abc then delete - then add a new XXX

Also
I don't really understand all this
  If Me.ReportDtID = 1 Then
  Me![Photo] = "none"
  Me![Page] = 999999999
   Me.Undo

Especially this
   Me.Undo

But as I can' see your DB you know best ?

I would step through the code o see what is doing the mischeaf.  Like this

Cut out all the bits you don't really need like this

Private Sub btnAddNew_Click()

ProjID.SetFocus

  If Me.ReportDtID = 1 Then
  Me![Photo] = "none"
  Me![Page] = 999999999
   Me.Undo
   DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
   DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Else
   DoCmd.GoToRecord , , acNewRec
End If
End Sub

Then see if this makes things OK.  If not then cut out line by line.  You
never know.

Hope this helps

Signature

Wayne
Manchester, England.

> Private Sub btnAddNew_Click()
> On Error GoTo Err_btnAddNew_Click
[quoted text clipped - 62 lines]
> > > > >
> > > > > Any suggestions?
 
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.