J
Jeff Conrad
Ok, this is really bizarre. I'm using Access 97.
I was having some "issues" with two combo boxes on an
unbound form so I decided to experiment on a brand new
database with just these two combo boxes on a form and I'm
seeing the same results! I don't often use unbound forms,
but I don't think that's the issue.
In my new test database this is ALL I have:
tblTimeBuckets:
TimeBucketID Number-Byte
TimeBucket Date/Time
The table looks like this:
1 12:00:00 AM
2 12:30:00 AM
3 1:00:00 AM
..
..
48 11:30:00 PM
Easy enough.
I have two combo boxes on an unbound form (nothing else)
with Row Sources of:
SELECT tblTimeBuckets.TimeBucketID,
tblTimeBuckets.TimeBucket FROM tblTimeBuckets;
They are named cboStartTime and cboEndTime and only the
time shows in the combo box.
What I'm trying to do is to prevent the user from
selecting an End Time that is BEFORE the Start Time. Easy
enough, right? HA! Not so!
In the After Update event of the End Time combo box I have
this:
If Me.cboEndTime.Column(1) < Me.cboStartTime.Column(1) Then
Me.cboStartTime = Me.cboEndTime
End If
MsgBox Me.cboStartTime 'Here for debugging
MsgBox Me.cboEndTime 'Here for debugging
(I have also tried just using Me.cboEndTime and
Me.cboEndTime.Value, etc. with same result)
What this is supposed to do is make the Start Time equal
to the End Time if the selected value is before the Start
Time.
I cannot possibly list all the different results I've
seen! Sometimes it works, but most often it does not.
Totally bizarre. It rarely works for anything below 10 AM!
Here's one of MANY weird tests:
1. Select say 1:00:00 PM in first box
2. Select say 1:30:00 PM in second box
Message box 1 says 27, message 2 says 28 All fine
3. Now select 10:00:00 AM in second box
Message box 1 says 27, message 2 says 21 but the start
time combo box does not change at all!!!
Other times it works flawlessly. There is no rhyme or
reason to this. Any ideas why this is not working?
Thanks,
Jeff Conrad
Bend, Oregon
I was having some "issues" with two combo boxes on an
unbound form so I decided to experiment on a brand new
database with just these two combo boxes on a form and I'm
seeing the same results! I don't often use unbound forms,
but I don't think that's the issue.
In my new test database this is ALL I have:
tblTimeBuckets:
TimeBucketID Number-Byte
TimeBucket Date/Time
The table looks like this:
1 12:00:00 AM
2 12:30:00 AM
3 1:00:00 AM
..
..
48 11:30:00 PM
Easy enough.
I have two combo boxes on an unbound form (nothing else)
with Row Sources of:
SELECT tblTimeBuckets.TimeBucketID,
tblTimeBuckets.TimeBucket FROM tblTimeBuckets;
They are named cboStartTime and cboEndTime and only the
time shows in the combo box.
What I'm trying to do is to prevent the user from
selecting an End Time that is BEFORE the Start Time. Easy
enough, right? HA! Not so!
In the After Update event of the End Time combo box I have
this:
If Me.cboEndTime.Column(1) < Me.cboStartTime.Column(1) Then
Me.cboStartTime = Me.cboEndTime
End If
MsgBox Me.cboStartTime 'Here for debugging
MsgBox Me.cboEndTime 'Here for debugging
(I have also tried just using Me.cboEndTime and
Me.cboEndTime.Value, etc. with same result)
What this is supposed to do is make the Start Time equal
to the End Time if the selected value is before the Start
Time.
I cannot possibly list all the different results I've
seen! Sometimes it works, but most often it does not.
Totally bizarre. It rarely works for anything below 10 AM!
Here's one of MANY weird tests:
1. Select say 1:00:00 PM in first box
2. Select say 1:30:00 PM in second box
Message box 1 says 27, message 2 says 28 All fine
3. Now select 10:00:00 AM in second box
Message box 1 says 27, message 2 says 21 but the start
time combo box does not change at all!!!
Other times it works flawlessly. There is no rhyme or
reason to this. Any ideas why this is not working?
Thanks,
Jeff Conrad
Bend, Oregon