Case select question

R

ryan.fitzpatrick3

Hi I have a case select code on my listbox. The listbox is called
ReportID, I have an event procedure on dbl click. But when I dbl click
the selection nothing happens. I have 2 columes of information that is
shown in the list box, column 1 has report name, column 2 has report
description. I put the report name in the case selection; from the
table were reportID pulls information from did I write down the
correct field information? Can anyone help me out?

Private Sub ReportID_DblClick(Cancel As Integer)
On Error GoTo handleErr

Select Case Me!ReportID
Case "Supply Plant Flour"
DoCmd.OpenReport "rptAllSupplyPlantFlour", acViewPreview, "",
"", acNormal
Case "Supply Plant Oil"
DoCmd.OpenReport "rptAllSupplyPlantOil", acViewPreview, "",
"", acNormal
Case "Supply Plant Honey"
DoCmd.OpenReport "rptAllSupplyPlantHoney", acViewPreview, "",
"", acNormal
Case "Supply Plant Molasses"
DoCmd.OpenReport "rptAllSupplyPlantMolasses", acViewPreview,
"", "", acNormal
Case "Supply Plant Sugar"
DoCmd.OpenReport "rptAllSupplyPlantSugar", acViewPreview, "",
"", acNormal
Case "Supply Plant Corn Sryups"
DoCmd.OpenReport "rptAllSupplyPlantHFCS", acViewPreview, "",
"", acNormal
Case Else
End Select
exithere:
Exit Sub

handleErr:
Select Case Err.Number
Case Else
MsgBox "Error" & Err.Number & ":" & Err.Description,
vbCritical
End Select

GoTo exithere

End Sub

Ryan
 
D

Douglas J. Steele

What's the bound column?

What do you see if you put MsgBox Me!ReportID inside that routine?
 
R

ryan.fitzpatrick3

It was the bound column, I thought I had the correct column in there,
but it was column 2 and not 1. Simple mistake. Thanks a million!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top