473,395 Members | 1,656 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,395 software developers and data experts.

How can I move the record pointer in a sub form.

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 to the key field as
specified in the main form.

Tanks for any help.

Kind regards,

Simon

Feb 15 '07 #1
1 5230
Is there some reason that you aren't using the LinkMasterFields and
LinkChildFields of the Subform Control? Main Form with Subform on identical
keys is a little unusual... can you clarify?

Or, do you have a continuous forms view Form in the Subform Control and want
to "scroll" the Records? If so, in a main Form with a Subform Control named
sbfMainRel, with the matching value in Control txtMainID on the main Form,
and the corresponding unique ID in the Field of the RecordSource of the
Form embedded in the Subform Control named MainRelID, the following worked
for me to "scroll" the continuous forms view in the Form embedded in the
Subform Control. {Note: for this code, it doesn't matter what the name of
the main Form is, nor the name of the Form embedded in the Subform Control.}
Replace the name of the subform control, the name of the Text Box where the
matching value is displayed on the main Form, and the name of the Field...
then put the code in the Current event of the main Form.

Private Sub Form_Current()

Me.sbfMainRel.Form.RecordsetClone.FindFirst "[MainRelID] = " &
Me.txtMainID
If Not Me.sbfMainRel.Form.RecordsetClone.NoMatch Then
Me.sbfMainRel.Form.Bookmark =
Me.sbfMainRel.Form.RecordsetClone.Bookmark
End If

End Sub

Larry Linson
Microsoft Access MVP
"Simon" <Sv********@Versatel.nlwrote in message
news:45**********************@news.tele2.nl...
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 to the key field as
specified in the main form.

Tanks for any help.

Kind regards,

Simon

Feb 15 '07 #2

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

Similar topics

2
by: Paolo | last post by:
Friends, I have created a form named FRMNEWCLIENTS whose record source is a table named NEWCLIENTS. This table has a field named FILENUMBER. I have added on the form a combobox using the third...
5
by: deko | last post by:
I have a subform datasheet that contains a full year of records sorted by a date field. I'm trying to programmatically move the record selector on the datasheet to the first record that matches a...
17
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an ADP I'm working on. Dim rs As ADODB.Recordset...
1
by: sixsoccer | last post by:
I have built a database with a <Mainform> and a <Subform>. My problem is twofold. 1. My subform is set as a continuos form with AllowAddiotions set to NO (ie. a list of Issues to the client on...
1
by: chfran | last post by:
I have a form (continuous) that show me data from a table (not a query). I can only modify and move between the data of the first record. I cannot move to the 2nd, 3rd, or 85th record, only the...
4
by: Arif | last post by:
My programs searches the header of input barcode in index file. Get the record position next to Barcode header. Then moves the file pointer of products file to reach that record. My products...
9
by: Joshua.Buss | last post by:
I am trying to move a record from one linked table to another within access, but I'm a complete beginner to VBA and don't know exactly where to begin. I have an access file that has the two...
16
by: KayCee | last post by:
Hello All - I'm new to the community. I have been asked to move the used of a database I created from a record in a table to the corresponding record of a form. After much research and trial &...
8
by: jmarcrum | last post by:
I have a table with about 100 records. The user has the ability to click a button on the main form that will open up a "move to the next year" form. A query displays all 100 records on the...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.