RE: Locating a record on a subform on a tabbed form
From: Jonathan Parminter (anonymous_at_discussions.microsoft.com)
Date: 03/21/04
- Next message: removethis: "John W. Vinson"
- Previous message: Steve Schapel: "Re: Can't get DoCmd.OpenReport to print only selected records"
- In reply to: Tony: "Locating a record on a subform on a tabbed form"
- Next in thread: Tony: "RE: Locating a record on a subform on a tabbed form"
- Reply: Tony: "RE: Locating a record on a subform on a tabbed form"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 20 Mar 2004 18:07:46 -0800
>-----Original Message-----
>Hi,
>
>How do I go to an exact record FROM a search form TO a
>subform that is located on a tabbed from on my main form.
>Can someone help?
>
>Thanks
>Tony
>
>Private Sub lstResult_DblClick(Cancel As Integer)
> Dim stDocName As String
> Dim stLinkCriteria As String
>
> stDocName = "frmMainForm"
> stLinkCriteria = "[EventID] = " & Me![EventID]
> DoCmd.OpenForm stDocName, , , stLinkCriteria
> DoCmd.Close acForm, "frmSearch"
>End Sub
>
>
>.
Hi Tony,
the following assumes that you are using the following
names...
Main form: frmMainForm
Tab control: tabCtl1
Subform control: sfrmSubForm
Also assumed is that the tab page that the subform
control is on is the second page.
Use the following as an example...
Private Sub lstResult_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
Dim frm as Form
Dim ctl as Control
stDocName = "frmMainForm"
' use to go to a main form record
stLinkCriteria = "[EventID] = " & Me![EventID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmSearch"
set frm=Forms(stDocName)!sfrmSubForm.form
set ctl=Forms(stDocName)!tabCtl1
' switch to second page of tab control
tabCtl1.value=1
' criteria for subform record
stLinkCriteria = "[RecordID] = " & Me![RecordID]
frm.recordsetclone.findfirst stLinkCriteria
if not frm.recordsetclone.nomatch then
frm.bookmark = frm.recordsetclone.bookmark
end if
End Sub
Luck
Jonathan
- Next message: removethis: "John W. Vinson"
- Previous message: Steve Schapel: "Re: Can't get DoCmd.OpenReport to print only selected records"
- In reply to: Tony: "Locating a record on a subform on a tabbed form"
- Next in thread: Tony: "RE: Locating a record on a subform on a tabbed form"
- Reply: Tony: "RE: Locating a record on a subform on a tabbed form"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|