G
Greg
On my main form I have a combo box where I am pulling respected phone number
based on group issue is assigned to. Here is the code:
Private Sub lstGroup_AfterUpdate()
Dim HasPhone As Variant
HasPhone = Me.lstGroup.Column(1)
If Len(HasPhone & "") = 0 Then
Me.txtPhoneday.Visible = False
Me.txtPhoneNight.Visible = False
Me.txtPhoneday = ""
Me.txtPhoneNight = ""
Else
Me.txtPhoneday.Visible = True
Me.txtPhoneNight.Visible = True
Me.txtPhoneday = HasPhone
Me.txtPhoneNight = Me.lstGroup.Column(2)
End If
End Sub
On the same form I have a subform where is am displaying issues that are
still outstanding. I want to click on record on a subform and display
ticket#, group and phone number. It is somehow working; however I noticed
that phone number is not being display correctly. Most of the time is a
number from previous record on a subform. Here is the code I am using on the
subform:
Private Sub Form_DblClick(Cancel As Integer)
Dim lngTicket As Long
Dim HasPhone As Variant
lngTicket = Me.[Ticket #]
HasPhone = Me.Parent.[lstGroup].Column(1)
If Len(HasPhone & "") = 0 Then
Me.Parent.[txtPhoneday].Visible = False
Me.Parent.[txtPhoneNight].Visible = False
Me.Parent.[txtPhoneday] = ""
Me.Parent.[txtPhoneNight] = ""
Else
Me.Parent.[txtPhoneday].Visible = True
Me.Parent.[txtPhoneNight].Visible = True
Me.Parent.[txtPhoneday] = HasPhone
Me.Parent.[txtPhoneNight] = Me.Parent.[lstGroup].Column(2)
End If
Me.Parent.Requery
Me.Parent.Recordset.FindFirst "[Ticket #]=" & lngTicket
Forms![Remedy Tickets]![Status].SetFocus
End Sub
Thanks for your help
based on group issue is assigned to. Here is the code:
Private Sub lstGroup_AfterUpdate()
Dim HasPhone As Variant
HasPhone = Me.lstGroup.Column(1)
If Len(HasPhone & "") = 0 Then
Me.txtPhoneday.Visible = False
Me.txtPhoneNight.Visible = False
Me.txtPhoneday = ""
Me.txtPhoneNight = ""
Else
Me.txtPhoneday.Visible = True
Me.txtPhoneNight.Visible = True
Me.txtPhoneday = HasPhone
Me.txtPhoneNight = Me.lstGroup.Column(2)
End If
End Sub
On the same form I have a subform where is am displaying issues that are
still outstanding. I want to click on record on a subform and display
ticket#, group and phone number. It is somehow working; however I noticed
that phone number is not being display correctly. Most of the time is a
number from previous record on a subform. Here is the code I am using on the
subform:
Private Sub Form_DblClick(Cancel As Integer)
Dim lngTicket As Long
Dim HasPhone As Variant
lngTicket = Me.[Ticket #]
HasPhone = Me.Parent.[lstGroup].Column(1)
If Len(HasPhone & "") = 0 Then
Me.Parent.[txtPhoneday].Visible = False
Me.Parent.[txtPhoneNight].Visible = False
Me.Parent.[txtPhoneday] = ""
Me.Parent.[txtPhoneNight] = ""
Else
Me.Parent.[txtPhoneday].Visible = True
Me.Parent.[txtPhoneNight].Visible = True
Me.Parent.[txtPhoneday] = HasPhone
Me.Parent.[txtPhoneNight] = Me.Parent.[lstGroup].Column(2)
End If
Me.Parent.Requery
Me.Parent.Recordset.FindFirst "[Ticket #]=" & lngTicket
Forms![Remedy Tickets]![Status].SetFocus
End Sub
Thanks for your help