P
PC User
I have a form "frmMAINEntry" with a tabcontrol with several pages. The
form's Record Source is a query "qryMainData"; however, on two of the
pages there's a difference. On the page "Program List" I have a
listbox that has a Row Source to table "tsubProgramList" and on the
page "Program Details" I have a subform that's Record Source is also
"tsubProgramList". The two pages of the tabcontrol are:
"ctlProgramDetails" and "ctlProgramList".
The table tsubProgramList contains these fields:
ProgramID..............AutoNumber
ProgramDescription...Text
Facility...................Text
ProgramCoordinator...Text
I'm trying to develop code that will allow me to doubleclick on an item
in the listbox, change pages and display the selected record in the
subform that's on the other page. See code below:
Code:
=================================================
Private Sub lstPrograms_DblClick(Cancel As Integer)
Dim strSelectID As String
Dim strListPick As String
Set strSearchID =
Forms![frmMAINEntry]![fsubProgramList].Form.[ProgramID]
strListPick = str(Nz(Me![lstPrograms], 0))
strSelectID.Bookmark = strListPick
Me![ctlProgramDetails].SetFocus
End Sub
=================================================
Someone's help would be greatly appreciated.
PC
form's Record Source is a query "qryMainData"; however, on two of the
pages there's a difference. On the page "Program List" I have a
listbox that has a Row Source to table "tsubProgramList" and on the
page "Program Details" I have a subform that's Record Source is also
"tsubProgramList". The two pages of the tabcontrol are:
"ctlProgramDetails" and "ctlProgramList".
The table tsubProgramList contains these fields:
ProgramID..............AutoNumber
ProgramDescription...Text
Facility...................Text
ProgramCoordinator...Text
I'm trying to develop code that will allow me to doubleclick on an item
in the listbox, change pages and display the selected record in the
subform that's on the other page. See code below:
Code:
=================================================
Private Sub lstPrograms_DblClick(Cancel As Integer)
Dim strSelectID As String
Dim strListPick As String
Set strSearchID =
Forms![frmMAINEntry]![fsubProgramList].Form.[ProgramID]
strListPick = str(Nz(Me![lstPrograms], 0))
strSelectID.Bookmark = strListPick
Me![ctlProgramDetails].SetFocus
End Sub
=================================================
Someone's help would be greatly appreciated.
PC