on click List box

  • Thread starter Thread starter Donna
  • Start date Start date
D

Donna

Is there a way that when an item in the list box is
clicked that another form will open and the item clicked
in the list box is the criteria for the query attached to
the form being opened??
 
yes =)

there's a code in www.mvps.org/access

I make something similar using that code... here is what
i've done (I open a report..)

.....
.....
....
Case 1
'OfferNo
Set Lst = Forms!frmFilters!LstOfferNo
strSQL = "SELECT * FROM tblMain WHERE ListID = "

'Juntando lo de la List Box
For Each varItem In Lst.ItemsSelected
strSQL = strSQL & Lst.ItemData(varItem) & " OR ListID = "
Next varItem

strSQL = Left$(strSQL, Len(strSQL) - 13)
strSQL = strSQL & " ORDER BY [Von] DESC;"

If Lst.ItemsSelected.Count = 0 Then
MsgBox "Please select one or more Offer Numbers !!"
Exit Sub
End If
If RptIsLoaded("rptTimeChart") Then
DoCmd.Close acReport, "rptTimeChart"
End If
DoCmd.OpenReport stDocName, acViewPreview, strSQL
Case 2
...........
..........
...........

Hope this helps you
 
Back
Top