473,406 Members | 2,439 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,406 software developers and data experts.

Using subform to go to record in subform

I have a form with two subforms on it. both subs have the same
controlsource. Subform1 is a continuous form that acts as an index. The
second subform is a single record that the user will use to edit the record.
There is a button (transparent) over the record on subform1 that when
clicked should force the second subform to goto that record. Any thoughts on
how to go about this?

Thanks Robert
Oct 7 '06 #1
3 4880
Robert wrote:
I have a form with two subforms on it. both subs have the same
controlsource. Subform1 is a continuous form that acts as an index. The
second subform is a single record that the user will use to edit the record.
There is a button (transparent) over the record on subform1 that when
clicked should force the second subform to goto that record. Any thoughts on
how to go about this?

Thanks Robert

Why a button? Why not in a dbl-click event? In form1, the click event
code could resemble
Dim rst As Recordset
set rst = Forms!Form2.Form.Recordsetclone

'change here to reflect your key
rst.FindFirst "ID = " & Me.ID

Forms!Form2.Form.BookMark = rst.BookMark
rst.close
set rst = Nothing
Oct 8 '06 #2
Not having much luck with below. I'm assuming that Forms!Form2... is
refering to Subform2? Even so, it isn't working. The button is on Subform1
(the index) and I am trying to change to record in Subform2 (the single
form).

So it should read Forms!Subform2.Form.Recordsetclone?

When I do this access return error 2450, it can't find the form frmSubform2

"salad" <oi*@vinegar.comwrote in message
news:12*****************@newsread3.news.pas.earthl ink.net...
Robert wrote:
>I have a form with two subforms on it. both subs have the same
controlsource. Subform1 is a continuous form that acts as an index. The
second subform is a single record that the user will use to edit the
record. There is a button (transparent) over the record on subform1 that
when clicked should force the second subform to goto that record. Any
thoughts on how to go about this?

Thanks Robert
Why a button? Why not in a dbl-click event? In form1, the click event
code could resemble
Dim rst As Recordset
set rst = Forms!Form2.Form.Recordsetclone

'change here to reflect your key
rst.FindFirst "ID = " & Me.ID

Forms!Form2.Form.BookMark = rst.BookMark
rst.close
set rst = Nothing

Oct 8 '06 #3
Robert wrote:
Not having much luck with below. I'm assuming that Forms!Form2... is
refering to Subform2? Even so, it isn't working. The button is on Subform1
(the index) and I am trying to change to record in Subform2 (the single
form).

So it should read Forms!Subform2.Form.Recordsetclone?

When I do this access return error 2450, it can't find the form frmSubform2
Sorry. When referring to a subform, you must make a reference to the
parent form. Ex:
Forms!MainForm!SubForm.Form...
>
"salad" <oi*@vinegar.comwrote in message
news:12*****************@newsread3.news.pas.earthl ink.net...
>>Robert wrote:

>>>I have a form with two subforms on it. both subs have the same
controlsource. Subform1 is a continuous form that acts as an index. The
second subform is a single record that the user will use to edit the
record. There is a button (transparent) over the record on subform1 that
when clicked should force the second subform to goto that record. Any
thoughts on how to go about this?

Thanks Robert

Why a button? Why not in a dbl-click event? In form1, the click event
code could resemble
Dim rst As Recordset
set rst = Forms!Form2.Form.Recordsetclone

'change here to reflect your key
rst.FindFirst "ID = " & Me.ID

Forms!Form2.Form.BookMark = rst.BookMark
rst.close
set rst = Nothing


Oct 8 '06 #4

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

Similar topics

4
by: YFS DBA | last post by:
How do I use VBA to insert a *new* record into a subform? I have a master form with client information, and a sub form with billing information. I want to click on a button ("Add Data") and have...
1
by: Max Harvey | last post by:
Hi, I made up a nice little form which had its own sub form in it. I made a litle VB code so that when I pressed a button it would move form the form (frmConference) to the subform...
5
by: Mary Litten | last post by:
Hi - (This is my very first post) I have gotten to this point of registering to post because I have been spinning my wheels so long, I believe I am all caught up in the weeds. (and mud) I have...
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...
0
by: CSDunn | last post by:
Hello, In Access ADP's that connect to SQL Server databases, any time I have a situation where I have a combo box in a main form that looks up a record in a subform, the subform record source has...
2
by: CSDunn | last post by:
Hello, In an Access 2003 ADP Subform, I am trying to set the BackGround color of three textbox fields (LSScore, RScore, WScore) in the current record of the subform to zero (black) if the value of...
5
by: Bob | last post by:
Hi Everybody I have a form called frmListBox that is connected to a table tblListBox. This is opened from a form called "frmInvoiceOrder" which has a subform called "zfrmInvoiceOrder" and...
18
by: Darryl Kerkeslager | last post by:
I don't do much with subforms - in fact I've deliberately avoided them - but .... I have a tab control that will contain several subforms, each bound to a separate table, and each table/subform...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
4
by: Elaine | last post by:
Hi I have created a form which contains a subform. To cut a long story short, I have created a macro that moves the focus to the subform (GoToControl) and sets a value (SetValue) in the field...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.