Form Field Count VBA

bmj121

New member
Local time
Yesterday, 19:33
Joined
Mar 9, 2012
Messages
2
Here is my code:
Code:
Private Sub Pages_AfterUpdate()
Select Case Me!Pages
Case 1 To 100
Output = 3
Case 101 To 150
Output = 4
Case 151 To 200
Output = 5
Case 201 To 250
Output = 6
Case 251 To 300
Output = 7
Case 301 To 350
Output = 8
Case 351 To 400
Output = 9
Case 401 To 450
Output = 10
Case 451 To 500
Output = 11
Case Else
Output = 12
MsgBox Output
End Select
End Sub

Right now, the only thing it will return anything for is if the value is based on the last case, so anything above 500. Why won't it pay attention to anything else?
 
It does pay attention, I can assure you. But you are assuming that you feed it with some value based on the result. Have you verified what the value of
Me!Pages is?
 
The question might be a bit ambiguous but it's only using the MsgBox in the Else part.

Try moving the MsgBox to below the End Select line.

Chris.
 
Chris,
Thanks that was it. Sorry, I'd been staring at the code all day. Now it seems painfully obvious. Apprwciate the second pair of eyes.
 

Users who are viewing this thread

Back
Top Bottom