A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using a subform to go to a record on the parent form



 
 
Thread Tools Display Modes
  #1  
Old February 26th, 2009, 09:50 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Using a subform to go to a record on the parent form

I have a parent form (FrmQSRecord) with 85 records. I have a child form
(frmQSDetail) that is linked to the parent form. Users will fill in the child
form as they click through the 85 records. The parent form is not updated,
the child form is.

I have a subform that links the two tables together in the record source and
displays all records so users can see which ones they have done (or missed).

I’d like to be able to have the users click a record in the subform and that
event loads that specific record in the parent form. The subform is a
continuous form. The recordID on the continuous form matches the recordID
that would be loaded.

What code allows me to do this? I don’t even begin to know where to look for
help.

tblQSRecord Contains RecordID
tblQSDetail Contains RecordID as foreign key

Parent form = tblQSRecord
Child form = tblQSDetail

Continuous subform = tblQSRecord + tblQsDetail

  #2  
Old March 1st, 2009, 02:38 PM posted to microsoft.public.access.tablesdbdesign
Dale Fye
external usenet poster
 
Posts: 2,651
Default Using a subform to go to a record on the parent form

Bob,

You could do something like the following:

1. Add a GoToRecord button in the footer of the subform. I'll assume that
this is what you are going to do, but you could also do this in the
DoubleClick event of a textbox in one of the controls in the subform.

2. Then write code similar to the following:

Private Sub cmd_GoToRecord_Click

Dim strCriteria as string
Dim rs as DAO.Recordset

strCriteria = "[RecordID] = " & me.RecordID
set rs = me.parent.recordsetclone

rs.findfirst strCriteria
if rs.nomatch then
msgbox "No match found"
else
me.parent.bookmark = rs.bookmark
endif

rs.close
set rs = nothing

End Sub

HTH
Dale


"Bob Waggoner" wrote in message
...
I have a parent form (FrmQSRecord) with 85 records. I have a child form
(frmQSDetail) that is linked to the parent form. Users will fill in the
child
form as they click through the 85 records. The parent form is not updated,
the child form is.

I have a subform that links the two tables together in the record source
and
displays all records so users can see which ones they have done (or
missed).

I'd like to be able to have the users click a record in the subform and
that
event loads that specific record in the parent form. The subform is a
continuous form. The recordID on the continuous form matches the recordID
that would be loaded.

What code allows me to do this? I don't even begin to know where to look
for
help.

tblQSRecord Contains RecordID
tblQSDetail Contains RecordID as foreign key

Parent form = tblQSRecord
Child form = tblQSDetail

Continuous subform = tblQSRecord + tblQsDetail



  #3  
Old March 3rd, 2009, 04:36 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Using a subform to go to a record on the parent form

Dale,
Thank you for your excellent help. I was able to do exactly what I wanted to
do! This has a lot of application to my quality systems database. Thanks!!!

"Dale Fye" wrote:

Bob,

You could do something like the following:

1. Add a GoToRecord button in the footer of the subform. I'll assume that
this is what you are going to do, but you could also do this in the
DoubleClick event of a textbox in one of the controls in the subform.

2. Then write code similar to the following:

Private Sub cmd_GoToRecord_Click

Dim strCriteria as string
Dim rs as DAO.Recordset

strCriteria = "[RecordID] = " & me.RecordID
set rs = me.parent.recordsetclone

rs.findfirst strCriteria
if rs.nomatch then
msgbox "No match found"
else
me.parent.bookmark = rs.bookmark
endif

rs.close
set rs = nothing

End Sub

HTH
Dale


"Bob Waggoner" wrote in message
...
I have a parent form (FrmQSRecord) with 85 records. I have a child form
(frmQSDetail) that is linked to the parent form. Users will fill in the
child
form as they click through the 85 records. The parent form is not updated,
the child form is.

I have a subform that links the two tables together in the record source
and
displays all records so users can see which ones they have done (or
missed).

I'd like to be able to have the users click a record in the subform and
that
event loads that specific record in the parent form. The subform is a
continuous form. The recordID on the continuous form matches the recordID
that would be loaded.

What code allows me to do this? I don't even begin to know where to look
for
help.

tblQSRecord Contains RecordID
tblQSDetail Contains RecordID as foreign key

Parent form = tblQSRecord
Child form = tblQSDetail

Continuous subform = tblQSRecord + tblQsDetail




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.