AndyCompanyZ
Registered User.
- Local time
- Today, 19:02
- Joined
- Mar 24, 2011
- Messages
- 223
Hi All
I am trying to find a solution to a piece of code I am building. What I have is a db that schedules delegates onto events. I am trying to work out some code that will check if the delegate is in the right area for the event. The events are held in 2 geographic areas (North and South) but have a number of venues (some in North and some in south). Delegates are also split into these 2 areas when they are entered itno the system.
I need to check that the event they have been scheduled for is in the right area and if not alert the user to this so that they can be scheduled onto an event in the right area.
This will be done from a form that the user will click a button to schedule and if everything is OK then it updates the delegate's table. I have a number of other checks currently running from this button to check if they have been already scheduled onto the same event or one running on the same day (this last one not quite working but that's on another thread).
The problem I am having is that the selection of an event is based on cascading comboboxes and the last box gives a selection of events corresponding to the course type that the delegate needs training on. This gives all the options of events but doesn't filter to correspond to North or South depending on the delegate's geographic location.
As I've been typing this I realised there might be a better way by filtering the options in the last combobox but not sure how to do this.
Originally I thought that I would write code that looked through the delegates details and flag up if the delegate was on the wrong event.
I wrote some pseudocode:
If DelegateLocation = 1 + VenueID = 2 or 5 + cmboEventID = 5,6,10,11,12,16,17 or 18 Then
msgbox OK
IF DelegateLocation = 2 + VenueID = 1,3 or 4 + cmboEventID = 1,2,3,4,7,8,9,13,14 or 15 Then
msgBox OK
Else
msgbox This is not in the right area for this delegate please reschedule
End if
But this seems a very longwinded way of doing it. After all this typing I realise that if I can finda way of filtering the combobox to only show the events that correspond to the delegates location it would be easier and cleaner. Funny how writing out what you need to do makes it clearer in your own head
So really I need a pointer on how to filter a combobox based on another criteria.
Sorry if this is very rambling and confusing.
Thanks to anyone who can read through my train of thought and point me where I need to go.
I am trying to find a solution to a piece of code I am building. What I have is a db that schedules delegates onto events. I am trying to work out some code that will check if the delegate is in the right area for the event. The events are held in 2 geographic areas (North and South) but have a number of venues (some in North and some in south). Delegates are also split into these 2 areas when they are entered itno the system.
I need to check that the event they have been scheduled for is in the right area and if not alert the user to this so that they can be scheduled onto an event in the right area.
This will be done from a form that the user will click a button to schedule and if everything is OK then it updates the delegate's table. I have a number of other checks currently running from this button to check if they have been already scheduled onto the same event or one running on the same day (this last one not quite working but that's on another thread).
The problem I am having is that the selection of an event is based on cascading comboboxes and the last box gives a selection of events corresponding to the course type that the delegate needs training on. This gives all the options of events but doesn't filter to correspond to North or South depending on the delegate's geographic location.
As I've been typing this I realised there might be a better way by filtering the options in the last combobox but not sure how to do this.
Originally I thought that I would write code that looked through the delegates details and flag up if the delegate was on the wrong event.
I wrote some pseudocode:
If DelegateLocation = 1 + VenueID = 2 or 5 + cmboEventID = 5,6,10,11,12,16,17 or 18 Then
msgbox OK
IF DelegateLocation = 2 + VenueID = 1,3 or 4 + cmboEventID = 1,2,3,4,7,8,9,13,14 or 15 Then
msgBox OK
Else
msgbox This is not in the right area for this delegate please reschedule
End if
But this seems a very longwinded way of doing it. After all this typing I realise that if I can finda way of filtering the combobox to only show the events that correspond to the delegates location it would be easier and cleaner. Funny how writing out what you need to do makes it clearer in your own head
So really I need a pointer on how to filter a combobox based on another criteria.
Sorry if this is very rambling and confusing.
Thanks to anyone who can read through my train of thought and point me where I need to go.