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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

criteria/case select hep

Status
Not open for further replies.

HOMMER

Technical User
Apr 12, 2001
112
US
In my form (frm_bm_Report) I have this code
Select Case optuniloy:
Case 0:
txtuniloyReportHeader = "All Uniloys"
txtuniloynumber = "*"
Case 1:
txtuniloyReportHeader = "Uniloy 1"
txtuniloynumber = "1"
Case 2:
txtuniloyReportHeader = "Uniloy 2"
txtuniloynumber = "2"
Case 3:
txtuniloyReportHeader = "Uniloy 3"
txtuniloynumber = "3"
Case 4:
txtuniloyReportHeader = "Uniloy 4"
txtuniloynumber = "4"

End Select

Then I have code to open a report that runs this qurey...
The query will run and fill in a criteria section from the form with this
Like [Forms]![frm_bm_Report]![txtuniloynumber]


this works great, but what I also need to do is add this
Case 5:
txtuniloyReportHeader = "Uniloy# 1 and #2"
txtuniloynumber = "1 and 2"

This code does not work
I need some help please...Thanks

 
You don't need all the ":" and I always use "Me." I would add another text box to use as the upper value of a range:
Select Case Me.optuniloy
Case 0
Me.txtuniloyReportHeader = "All Uniloys"
Me.txtuniloynumber = "0"
Me.txtuniloynumberMax = "100"
Case 1
Me.txtuniloyReportHeader = "Uniloy 1"
Me.txtuniloynumber = "1"
Me.txtuniloynumberMax = "1"
Case 2
Me.txtuniloyReportHeader = "Uniloy 2"
Me.txtuniloynumber = "2"
Me.txtuniloynumberMax = "2"

Case 5
Me.txtuniloyReportHeader = "Uniloy# 1 and #2"
Me.txtuniloynumber = "1"
Me.txtuniloynumberMax = "2"
End Select
Between [Forms]![frm_bm_Report]![txtuniloynumber] AND [Forms]![frm_bm_Report]![txtuniloynumberMax]


Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top