No Damon;
The problem is that the same report opens in all cases. Which means that
the
case statement is not picking up the value of the combo box.
The open report works perfectly and it tells me which records in the list
box it is about to print.
Now what I am trying to do is limit the list box to all items that start
with a C, then print the C report
Limit items to all that start with a B then print all items that Start
with
a B , then Print the B report (I called it report2 for example).
The "ProductID IN " & strSelected statement.is flawless. I worked it out.
Happy 4th of July. Proud to be an American.
I would suggest you put a breakpoint at the beginning of your case stmt
and
step thru the code, checking values-- if the code picks the correct
report
name, then the problem is in your DoCmd.OpenReport stDocName,
acViewPreview,
, "ProductID IN " & strSelected statement.
Damon
Doug;
No luck. No Errors but no results.
Thanks for your time
message
Given you were trying to use Column(1) in your first example, try
Select Case Left(Me.Combo28.Column(1) & "", 1)
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Sorry John; I did not work ! Any other ideas?
Select Case Left(Me.Combo28 & "",1)
Case "B"
stDocName = "Productsreport1"
Case "C"
stDocName = "Productsreport2"
Case Else
stDocName = "Productsreport"
End Select
DoCmd.OpenReport stDocName, acViewPreview, , "ProductID IN " &
strSelected
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
strive4peace wrote:
hi Tony
"Me![Combo28].column(1) = Like'B*'"
--> left(Me![Combo28].column(1),1) = "B"
"Me![Combo28].column(1) = 'Like'C*''"
--> left(Me![Combo28].column(1),1) = "C"
Warm Regards,
Crystal
remote programming and training
Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace
*
have an awesome day
*
tony Jacobs wrote:
I am having trouble with this code can anyone help.
I have the follwing case statement that checks the value of the
combo
box,
and based on that it will select which report to print, but I
can
not
get it
to work
Select Case ReportPrint
Case "Me![Combo28].column(1) = Like'B*'"
stDocName = "Productsreport1"
Case "Me![Combo28].column(1) = 'Like'C*''"
stDocName = "Productsreport2"
Case Else
stDocName = "Productsreport"
End Select
DoCmd.OpenReport stDocName, acViewPreview, , "ProductID IN "
&
strSelected
Thanks in advance