Sausagefingers
Registered User.
- Local time
- Today, 17:17
- Joined
- Dec 14, 2006
- Messages
- 51
Hi,
I've managed to drop myself in it again! My boss has asked me to take charge of one of our existing Access dbs. The guy who wrote it is no longer with us and I can no longer contact him for advice and help on it.
It is, essentially, a stock take tool and I've been saddled with the task of adding a little more functionality here and there.
One of my tasks is to isolate and show (currently by forms/reports) areas (locations) in the warehouse where stock is showing both a quantity difference and a currency variance during stock count.
Currently, we have:
1. A 'Freeze' qty/value
2. A 'Count' qty/value
3. A 'Recount 1' qty/value
4. A 'Recount 2' qty/value
5. A 'Recount 3' qty/value
6. A 'Final Count' qty/value
for every catalogue number in every area of the warehouse.
I've produced a set of querys and forms that I want to run from an OnClick() event from one of the existing forms I have to work with.
The existing form displays (in Datasheet view) checkboxes indicating whether or not a count has been completed (countOne through countSix) and the name of that area. I want to display the appropriate quantity differences and currency variances for that area via the OnClick() event on completed counts.
So, at present I have a MESS of nested If's that are neither easy to read OR work properly. I'm now desperate for help as this needs some testing as early as Friday or early next week.
I guess I should be using a 'Select Case' statement but I'm not sure how to do this. I spent some time yesterday trying and get my head around the concept but produced nothing! I get the very basic idea but the specifics of my problem are a little too hard for me to fathom
If I can explain what I'm trying to achieve, maybe somebody can offer me some help. For example:
If checkOne and checkTwo = True I want to open Form1
If checkOne, checkTwo and checkThree = True I want to open Form2
If checkOne, Two, Three and Four = True open Form3 and so on.
All these forms are basically comparisons BETWEEN the completed counts.
A problem occurs if for example, "Area1" has a freeze count and the first count matches the freeze, a recount is not required.
In the above example, only checkOne, Two and Six would ever be True.
How would I write a Select Case statement which could cover all these eventualities??
Sorry for the long-winded post but panic mode is setting in
Below is a sample of the mess i've been making for myself:
If chkCountOne.Value And chkCountTwo.Value = True And chkCountThree.Value = False Then
stDocName = "frm_difference1"
stLinkCriteria = "zoneAisle = '" & Me.strZone & "" & Me.strAisle & "' "
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria
End If
' If chkCountOne.Value And chkCountTwo.Value And chkCountThree.Value = True And chkCountFour = False Then
stDocName = "frm_difference2"
stLinkCriteria = "zoneAisle = '" & Me.strZone & "" & Me.strAisle & "' "
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Thanks in advance
I've managed to drop myself in it again! My boss has asked me to take charge of one of our existing Access dbs. The guy who wrote it is no longer with us and I can no longer contact him for advice and help on it.
It is, essentially, a stock take tool and I've been saddled with the task of adding a little more functionality here and there.
One of my tasks is to isolate and show (currently by forms/reports) areas (locations) in the warehouse where stock is showing both a quantity difference and a currency variance during stock count.
Currently, we have:
1. A 'Freeze' qty/value
2. A 'Count' qty/value
3. A 'Recount 1' qty/value
4. A 'Recount 2' qty/value
5. A 'Recount 3' qty/value
6. A 'Final Count' qty/value
for every catalogue number in every area of the warehouse.
I've produced a set of querys and forms that I want to run from an OnClick() event from one of the existing forms I have to work with.
The existing form displays (in Datasheet view) checkboxes indicating whether or not a count has been completed (countOne through countSix) and the name of that area. I want to display the appropriate quantity differences and currency variances for that area via the OnClick() event on completed counts.
So, at present I have a MESS of nested If's that are neither easy to read OR work properly. I'm now desperate for help as this needs some testing as early as Friday or early next week.
I guess I should be using a 'Select Case' statement but I'm not sure how to do this. I spent some time yesterday trying and get my head around the concept but produced nothing! I get the very basic idea but the specifics of my problem are a little too hard for me to fathom

If I can explain what I'm trying to achieve, maybe somebody can offer me some help. For example:
If checkOne and checkTwo = True I want to open Form1
If checkOne, checkTwo and checkThree = True I want to open Form2
If checkOne, Two, Three and Four = True open Form3 and so on.
All these forms are basically comparisons BETWEEN the completed counts.
A problem occurs if for example, "Area1" has a freeze count and the first count matches the freeze, a recount is not required.
In the above example, only checkOne, Two and Six would ever be True.
How would I write a Select Case statement which could cover all these eventualities??
Sorry for the long-winded post but panic mode is setting in

Below is a sample of the mess i've been making for myself:
If chkCountOne.Value And chkCountTwo.Value = True And chkCountThree.Value = False Then
stDocName = "frm_difference1"
stLinkCriteria = "zoneAisle = '" & Me.strZone & "" & Me.strAisle & "' "
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria
End If
' If chkCountOne.Value And chkCountTwo.Value And chkCountThree.Value = True And chkCountFour = False Then
stDocName = "frm_difference2"
stLinkCriteria = "zoneAisle = '" & Me.strZone & "" & Me.strAisle & "' "
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Thanks in advance