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

use an array to count available channels?

Status
Not open for further replies.

ruthcali

Programmer
Apr 27, 2000
470
US
i have a table called Channels with the following fields:<br>ID (foreign key), channel 1, channel 2, channel 3, channel 4, channel 5, channel 6, channel 7, channel 8.<br><br>i have another table called Circuits with the following fields:<br>ID (autonumber-primary key), Site#1ID, Site#2ID.<br><br>so between site#1 and site#2, there are 8 channels. an example of a record is:<br><br>site#1id: buildingA&nbsp;&nbsp;&nbsp;&nbsp;<br>site#2id: buildingC<br>ch1:<br>ch2: AB48<br>ch3: CB48<br>ch4:<br>ch5:<br>ch6:<br>ch7:<br>ch8: BN48<br><br>another example is:<br>site#1id: buildingA<br>site#2id: buildingG<br>ch1: BI48<br>ch2: GH48<br>ch3:<br>ch4:<br>ch5:<br>ch6:<br>ch7: PL48<br>ch8:<br><br>so there are two endpoint buildings whose order isn't important.&nbsp;&nbsp;Ex:&nbsp;&nbsp;site#1id: buildingR going to site#2id: buildingG. i can also have another record:&nbsp;&nbsp;site#1id:&nbsp;&nbsp;buildingG going to site#2id:buildingR.&nbsp;&nbsp;or site#1id: buildingR going to site#2id: buildingY, etc.<br><br>what i have to do is make a report showing site#1, site#2, total number of channels, and the channels available.<br><br>lets say there are two records containing the buildings C and T. one record is using two channels and the other record is using three channels. the final result i need to show would be:<br><br>Between BuildingC and Buildng T there are 16 total channels with 11 channels available.<br><br>any idea of how to do this? would i use an arry? please help!!
 
How many records are we talking about total?<br>First of all you need a loop<br>For-Next probably. Loop the number of records<br><br>For A = 1 to rst.recordcount<br>' Examine your results using IF statement or Select Case<br>' Maybe make a third table where you write the results to<br>Next<br><br>Base your report off of the third table. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
hi,<br><br>thanks for your help, but is there any way you could be a little more specific. i am a bit stuck. :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top