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 / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

goto next record in a datasheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dp - 25 Jan 2005 19:49 GMT
Hi guys

I am trying to create a subroutine that will loop through a recordset of
items and add them to a new record in a subform in datasheet mode.  However,
I cannot seem to get the action to goto the next record.  It "cannot go to
specified record" if I use:

DoCmd.GoToRecord , , acNewRec

Here is my code:

Do While Not rsItemGroups.EOF

    DoCmd.GoToRecord , , acNewRec
 
       Me.Item = Nz(rsItemGroups!ListID)
       Me.Quantity = rsItemGroups!Quantity

I tried using a recordset clone to move to the next record, addnew and
update, however, I have a combo box that sets some of the fields as well as
some event handlers that dont seem to work with this method.

Any suggestions?

Thanks
David
dp - 25 Jan 2005 20:05 GMT
Additional info:

The procedure is in a fields AfterUpdate event.

I tried:
DoCmd.GoToRecord acDataForm, me.Name, acNewRec

this gave me an error:

The object "subform" is not opened

> Hi guys
>
[quoted text clipped - 22 lines]
> Thanks
> David
John Vinson - 25 Jan 2005 22:05 GMT
>Additional info:
>
[quoted text clipped - 6 lines]
>
>The object "subform" is not opened

A Subform is not open in its own right, only as part of the containing
form.

Try:

Me.subformname.SetFocus
Me.subformname.SomeControl.SetFocus
DoCmd.GoToRecord, , acNewRecord

                 John W. Vinson[MVP]    
dp - 25 Jan 2005 22:35 GMT
Hi John,

Thanks for responding
I tried your method and received error:
"Invalid method in an expression"

Also, the event handler is in the subform, not the main form.

So, i tried me.setfocus instead.

But that did not work.

What I want to do is when a user selects a "group" item in subdatasheet item
combo box
>> go to next record in subdatasheet
>> loop through recordset of group items
>> populate those records

I tried Recordset clone but,I  have some event handlers that are tied to
the fields so, the recordset clone thing does not handle this

it sounded easy in my mind....

Dp
 
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



©2008 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.