Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open form based on list box selection

Status
Not open for further replies.

YewNork

Technical User
Aug 6, 2001
33
CA
Hi, I have done this before, but can't duplicate it.
What I'd like to do is open a form based on the selection in a list box.
The list box displays escalations with ticket number and date. When double clicked, the escalation form should open for that customer & ticket number. Here's the code:
*********
Private Sub lstNorstarEsc_DblClick(Cancel As Integer)
On Error GoTo Err_lstNorstarEsc_DblClick

Dim strChooseEsc As String
strChooseEsc = "xRef = " & _
"'" & Forms!frmNorstar!ndx & "'" & _
" AND ITAStkt = " & "'" & Forms!frmNorstar!lstNorstarEsc.Column(1) & "'"
DoCmd.OpenForm "frmNorstarEsc", , , strChooseEsc, acFormEdit

Exit_lstNorstarEsc_DblClick:
Exit Sub

Err_lstNorstarEsc_DblClick:
MsgBox Err.Description
Resume Exit_lstNorstarEsc_DblClick
End Sub
*********

Thanks for any help...

LDS (TELUS)
 
Hi, apparently the underlying table was not numeric in this case (in the "copied from" it was) so, when I removed the single quotes from the line:
"'" & Forms!frmNorstar!ndx & "'" & _
it got better.

Thanx much....


LDS (TELUS)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top