LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default For Toppers

Hi Toppers,
It is all working now but I have placed the code for the 'ComboBoxActivity'
below, this code populates from TextBox3. The difficulty was that (a) the
available list for 'ComboBoxOffence' had to relate to the 'UNIT' in
'TextBox3' and the Activity in 'ComboBoxActivity'. A workaround using help
from in the States has evolved the code below, I am sure this can be
tightened up but it is working at the moment so there is progress!. One
later issue will be that I will want to calculate the Sanctioned Detections
etc. on a Monthly basis but this format will give me different values for
X.Sanctioned Detections and R.Sanctioned Detections etc. I am hoping that I
can add the two values together for one monthly chart and have bought John
Walkenbach's Excel 2003 Formulas book to help out.

As an aside, can you tell me how I simply populate a ComboBox from a range
of values, I have tried -

ControlBox1.List = Array("A Div", "B Div", "C Div") but that did not work, I
added it to ControlBox1_Change()

but that failed. Here is the code to drive ComboBoxActivity -

================================================== =========================
Private Sub LoadActivityDropdown()

Dim FoundCell As Range
Dim Rng As Range
Dim UnitTxt As String
UnitTxt = Me.TextBox3.Text
Set FoundCell = Range("UnitTypeList").Find(what:=UnitTxt,
after:=Range("UnitTypeList")(1, 1), lookat:=xlWhole, MatchCase:=False)
If Not FoundCell Is Nothing Then
With Me.ComboBoxActivity
.Clear
Select Case FoundCell.Text
Case "RPU 1", "RPU 2", "RPU 3", "RPU 4", "RPU 5"
.AddItem "R.Sanctioned Detection"
.AddItem "R.Other Arrest"
.AddItem "R.Roads Policing"
.AddItem "R.Speeding"
.AddItem "R.ANPR Other"
.AddItem "R.POMAN Other"
Case "RPU 6", "RPU 7", "Enforcement"
.AddItem "Sanctioned Detection"
.AddItem "X.Other Arrest"
.AddItem "X.Roads Policing"
.AddItem "X.Speeding"
.AddItem "X.ANPR Other"
.AddItem "X.POMAN Other"
Case "TVCU"
.AddItem "T.Sanctioned Detection"
.AddItem "T.Other Arrest"
.AddItem "T.POMAN Other"
Case "MetroLink"
.AddItem "M.Sanctioned.Detection"
.AddItem "M.Other Arrest"
.AddItem "M.POMAN Other"
.AddItem "M.Visibility"
Case "Traffic Warden"
.AddItem "W.Speeding"
.AddItem "W.POMAN Other"
.AddItem "W.Visiblity"
Case "Investigation", "OPU", "TMU", "Policy Unit", "Accident
Records", "Camera Enforcement", "NRSI", "Admin"
.AddItem "Not Applicable"
Case Else
End Select
End With
End If
End Sub
================================================== ===================================

Regards,
Mickey


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
reading from SQL Texas Tonie[_2_] Excel Discussion (Misc queries) 0 November 9th 07 10:59 PM
Reading XML Ajit Excel Discussion (Misc queries) 1 October 2nd 07 10:54 PM
reading statements mike Excel Programming 4 February 20th 04 01:47 PM
reading xls from asp mrweb Excel Programming 0 October 20th 03 08:54 PM
sub for reading Fernando Duran Excel Programming 4 September 15th 03 07:52 PM


All times are GMT +1. The time now is 08:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"