473,394 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Move to next record on Subform.

I am trying to move a subform onto the next record with:

DoCmd.GoToRecord acForm, "MaintainAssets_edit", acNext

but when I do this I get "The object 'MaintainAssets_edit' is isn't
open". I know I could easily put the controls in the subform itself
but I want the record controls at the top of the page, outside of the
subform.

Thanks for looking.

Matt
Jun 27 '08 #1
3 26835
"Lynx101" <ma**********@gmail.comwrote in message
news:cd**********************************@m36g2000 hse.googlegroups.com...
>I am trying to move a subform onto the next record with:

DoCmd.GoToRecord acForm, "MaintainAssets_edit", acNext

but when I do this I get "The object 'MaintainAssets_edit' is isn't
open". I know I could easily put the controls in the subform itself
but I want the record controls at the top of the page, outside of the
subform.

Thanks for looking.

Matt
Open the form MaintainAssets_edit in design view. Switch to the VB
environment and create a public procedure in the form's module:

Public Sub MoveToNext()
DoCmd.GoToRecord acForm, Me.Name, acNext
End Sub

Save the form, then in your main form, substitute the DoCmd line with:

Me.SubformControlName.Form.MoveToNext

Replace 'SubformControlName' with the name of the control housing the form
MaintainAssets_edit.

The procedure is visible to the main form because it is declared Public. The
code executes in the context of the subform.
Jun 27 '08 #2
Really appreciate your response. I've put in the code but still get
"The object 'MaintainAssets_edit' is isn't open". The only other thing
I can say about the sub form that allowedits=false. Really wierd.
Jun 27 '08 #3
"Lynx101" <ma**********@gmail.comwrote in message
news:cd**********************************@m36g2000 hse.googlegroups.com...
>I am trying to move a subform onto the next record with:

DoCmd.GoToRecord acForm, "MaintainAssets_edit", acNext

but when I do this I get "The object 'MaintainAssets_edit' is isn't
open". I know I could easily put the controls in the subform itself
but I want the record controls at the top of the page, outside of the
subform.

Thanks for looking.

Matt
Matt,
Set focus to the subform, then move next, then set focus back to main form.
Fred Zuckerman

' Caution: Air Code
Me.SubForm.SetFocus
DoCmd.GoToRecord ,, AcNext
Me.MainForm.SetFocus

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: William Wisnieski | last post by:
Hello Everyone, Access 2000, I have a main unbound form with a bound datasheet subform . The subform is bound to a query that returns records based on criteria in the main form. The user...
15
by: Susan Bricker | last post by:
Greetings. I have a Mainform with a subform. The Mainform has single record format and subform has continuous form format. When the Mainform opens, I force allowadditions and allowedits to FALSE...
2
by: Gerry Abbott | last post by:
Hi all, Ive got a bound form (its actually a subform), but want to ensure that a specific field is populated before the user can move away from that record. Can anyone suggest the best method...
11
by: scsTiger | last post by:
I am using Access 2000 as the front end and MS SQL 2000 as the backend. I have a one record form that I set using something like: strSQL = "SELECT * FROM dbo_WBACCT WHERE...
1
by: Simon | last post by:
Dear reader, How can I move the record pointer in a sub form. The sub form is a datasheet type. Both forms have the same reference key. How can I move the record pointer in the sub form...
2
by: bhipwell via AccessMonster.com | last post by:
I need to put a button that allows the user to move to the next record. On the form, I have a list of employees that are filtered by the company they work for. Obviously, if I use the simple...
2
by: gavm360 | last post by:
Hello, I have a data entry form that has a button to copy the values of fields (CASECODE,STEPDES,CBOANSWER) into the fields (CASECODE,STEPDES,ANSWER) of a subform on the page. Private Sub...
1
by: stuart | last post by:
I have a list of records in a subform that a user can either edit or delete. This is an unbound form. If the user deletes a record, I want to refresh the form, and then position the cursor on the...
1
by: sblakethomas | last post by:
I created a code that would take me from the last field in a subform and take me to the next record first field on the parent form. Unfortunately, there is a little snag if I try to use the mouse to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.