A
AHopper
In the On Open event of a form I use the following to
calculate the maximum and minimum number required to do a
job.
With Me
MaxRequired = ((Fix(Nz(.MasterUnits) / 9)) + 1) * Nz
(.JobQty)
MinRequired = (Fix(Nz(.MasterUnits) / 9)) * Nz(.JobQty)
End With
On the same form I have nine text boxes (TSA1 through TSA9)
that I would like to count the following:
1)how many are equal to or greater than the minrequired
2) how many are equal to or greater than the maximum
required.
3)how many are greater than the minimum required.
Using the following I can count the number of low numbers,
high numbers and the number over the low number.
Dim dblLowestTA As Double
Dim dblHighestTA As Double
Dim dblValueTA As Double
Dim CountMin As Integer
Dim CountMax As Integer
CountMin = 0
CountMax = 0
CountOverMin = 0
For intControl = 1 To 9
dblValueTA = Me.Controls("TSA" & intControl).Value
If dblValueTA = dblLowestTA Then CountMin =
CountMin + 1
If dblValueTA = dblHighestTA Then CountMax =
CountMax + 1
If dblValueTA > dblLowestTA Then CountOverMin =
CountOverMin + 1
I made the following modification to count text boxes
equal to or greater than MinRequired and equal to or
greater than MaxRequired but so far I have had no success.
Dim dblLowestTA As Double
Dim dblHighestTA As Double
Dim dblValueTA As Double
Dim CountMin As Integer
Dim CountMax As Integer
CountMin = 0
CountMax = 0
CountOverMin = 0
For intControl = 1 To 9
dblValueTA = Me.Controls("TSA" & intControl).Value
If (dblValueTA >= MinRequired) = dblLowestTA Then
CountMin = CountMin + 1
If (dblValueTA >= MaxRequired) = dblHighestTA Then
CountMax = CountMax + 1
If dblValueTA > dblLowestTA Then CountOverMin =
CountOverMin + 1
Thank you in advance for your help.
Allan
calculate the maximum and minimum number required to do a
job.
With Me
MaxRequired = ((Fix(Nz(.MasterUnits) / 9)) + 1) * Nz
(.JobQty)
MinRequired = (Fix(Nz(.MasterUnits) / 9)) * Nz(.JobQty)
End With
On the same form I have nine text boxes (TSA1 through TSA9)
that I would like to count the following:
1)how many are equal to or greater than the minrequired
2) how many are equal to or greater than the maximum
required.
3)how many are greater than the minimum required.
Using the following I can count the number of low numbers,
high numbers and the number over the low number.
Dim dblLowestTA As Double
Dim dblHighestTA As Double
Dim dblValueTA As Double
Dim CountMin As Integer
Dim CountMax As Integer
CountMin = 0
CountMax = 0
CountOverMin = 0
For intControl = 1 To 9
dblValueTA = Me.Controls("TSA" & intControl).Value
If dblValueTA = dblLowestTA Then CountMin =
CountMin + 1
If dblValueTA = dblHighestTA Then CountMax =
CountMax + 1
If dblValueTA > dblLowestTA Then CountOverMin =
CountOverMin + 1
I made the following modification to count text boxes
equal to or greater than MinRequired and equal to or
greater than MaxRequired but so far I have had no success.
Dim dblLowestTA As Double
Dim dblHighestTA As Double
Dim dblValueTA As Double
Dim CountMin As Integer
Dim CountMax As Integer
CountMin = 0
CountMax = 0
CountOverMin = 0
For intControl = 1 To 9
dblValueTA = Me.Controls("TSA" & intControl).Value
If (dblValueTA >= MinRequired) = dblLowestTA Then
CountMin = CountMin + 1
If (dblValueTA >= MaxRequired) = dblHighestTA Then
CountMax = CountMax + 1
If dblValueTA > dblLowestTA Then CountOverMin =
CountOverMin + 1
Thank you in advance for your help.
Allan