Hi, I have a form that has a combobox and a tab control. The selection in the combobox determines which tabs are visible on current event.
On one of the tabs I have a search window, when the user double clicks on the name the focus moves to that record in one of the tabs.
What I am trying to do is determine which tab to open on double click. So for an example, if the combobox = Lease than it should open to tab 2, if combobox = Retail Sale then it should open to tab 4. I cannot seem to figure out how to apply that logic to this code that opens the record from my search box.
Any suggestions?
Fen
Private Sub lstItems2_DblClick(Cancel As Integer)
Dim RowNumber As Integer
RowNumber = Me.lstItems2.ListIndex + 1
Dim Customer, DNLID
Customer = (lstItems2.Column(0, RowNumber))
DNLID = (lstItems2.Column(1, RowNumber))
'Dim Response As Integer
'Response = MsgBox("Detail" & "ForMoreInformationclickok,vbOKCancel")
'If Response = vbOK Then
'If Combo432 = "Retail Sale" Then
DoCmd.OpenForm "frm_DriveNow_lease", , , "[DNLID]=" & lstItems2.Column(1)
With Forms("frm_DriveNow_lease")
!TabCtl267.Value = 2
End With
'Else
'End If
End Sub
On one of the tabs I have a search window, when the user double clicks on the name the focus moves to that record in one of the tabs.
What I am trying to do is determine which tab to open on double click. So for an example, if the combobox = Lease than it should open to tab 2, if combobox = Retail Sale then it should open to tab 4. I cannot seem to figure out how to apply that logic to this code that opens the record from my search box.
Any suggestions?
Fen
Private Sub lstItems2_DblClick(Cancel As Integer)
Dim RowNumber As Integer
RowNumber = Me.lstItems2.ListIndex + 1
Dim Customer, DNLID
Customer = (lstItems2.Column(0, RowNumber))
DNLID = (lstItems2.Column(1, RowNumber))
'Dim Response As Integer
'Response = MsgBox("Detail" & "ForMoreInformationclickok,vbOKCancel")
'If Response = vbOK Then
'If Combo432 = "Retail Sale" Then
DoCmd.OpenForm "frm_DriveNow_lease", , , "[DNLID]=" & lstItems2.Column(1)
With Forms("frm_DriveNow_lease")
!TabCtl267.Value = 2
End With
'Else
'End If
End Sub