N
Need HELP!
I have a database that I am using for vacations. I have a
select case code that figures out how many shifts the
employee is entitled to based on their start date. There
is a subform that lists the dates they have booked, and a
field that counts how many shifts they have booked.
One other field ( text26 ) simply subtracts the amount of
shifts they are allowed from the amount they have taken.
My goal here was that when the amount of shits left hits
zero the button used to book a vacation date ( command
49 ) would not longer be enabled. I put the code in and
it would not work. Here is where it gets weird. If I but
a stop in the code, and then step through each line. IT
WORKS. But if I just let the code run it wont work. I
emailed the entire database to an access professional, and
he tells me he is using access 2003 and has no problems
with it, that it works fine for him. I am using access
2000 and it will not work unless i Stop the code and
execute one line at a time (f8). Code is as follows, and
I would be forever greateful to anyone who can dispell
this terrible mystery for me. Cheers. Todd
Private Sub Form_Current()
DoCmd.Maximize
Dim HotOrNot As Boolean
Select Case Me.Expr1
Case 0 To 4.9
Me.intShiftsAllowed = "7"
Case 5 To 14.9
Me.intShiftsAllowed = "11"
Case 15 To 100
Me.intShiftsAllowed = "14"
Case Else
Me.intShiftsAllowed = "99"
End Select
Form.[table1 subform].Requery
If Me.Text26 <= 0 Then
HotOrNot = False
Else
HotOrNot = True
End If
Me.Command49.Enabled = HotOrNot
End Sub
p.s. I have tried several different versions of the code,
and put it in several different events, but it does not
seem to make a difference.
select case code that figures out how many shifts the
employee is entitled to based on their start date. There
is a subform that lists the dates they have booked, and a
field that counts how many shifts they have booked.
One other field ( text26 ) simply subtracts the amount of
shifts they are allowed from the amount they have taken.
My goal here was that when the amount of shits left hits
zero the button used to book a vacation date ( command
49 ) would not longer be enabled. I put the code in and
it would not work. Here is where it gets weird. If I but
a stop in the code, and then step through each line. IT
WORKS. But if I just let the code run it wont work. I
emailed the entire database to an access professional, and
he tells me he is using access 2003 and has no problems
with it, that it works fine for him. I am using access
2000 and it will not work unless i Stop the code and
execute one line at a time (f8). Code is as follows, and
I would be forever greateful to anyone who can dispell
this terrible mystery for me. Cheers. Todd
Private Sub Form_Current()
DoCmd.Maximize
Dim HotOrNot As Boolean
Select Case Me.Expr1
Case 0 To 4.9
Me.intShiftsAllowed = "7"
Case 5 To 14.9
Me.intShiftsAllowed = "11"
Case 15 To 100
Me.intShiftsAllowed = "14"
Case Else
Me.intShiftsAllowed = "99"
End Select
Form.[table1 subform].Requery
If Me.Text26 <= 0 Then
HotOrNot = False
Else
HotOrNot = True
End If
Me.Command49.Enabled = HotOrNot
End Sub
p.s. I have tried several different versions of the code,
and put it in several different events, but it does not
seem to make a difference.