combobox positioning

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to replicate the time selection in MS Office Calendar where you
select the start time for an existing event. I prepopluate the combobox with
times starting at 12:00 AM to 11:45 PM.

When a record is selected I want the combobox to position to the .value in
the combobox. In other words, if a record has a start time of 9:30 AM, I
need the combobox to open the drop down and highlight the 9:30 AM
entry...just like the MS Office Calendar when you modify an existing entry.

I've tried
ctr = 0
Do Until Me.calendar_start.ItemData(ctr) =
Format(Me.calendar_start.Value, "hh:mm AMPM")
ctr = ctr + 1
Loop

With Me.calendar_start
.Value = .ItemData(ctr)
End With

and Access cries that I can't set the value of the object.

Please help...this has been driving me crazy for over 2 days.

Any help would be appreciated.
 
PeterM said:
I'm trying to replicate the time selection in MS Office Calendar
where you select the start time for an existing event. I prepopluate
the combobox with times starting at 12:00 AM to 11:45 PM.

When a record is selected I want the combobox to position to the
.value in the combobox. In other words, if a record has a start time
of 9:30 AM, I need the combobox to open the drop down and highlight
the 9:30 AM entry...just like the MS Office Calendar when you modify
an existing entry.

I've tried
ctr = 0
Do Until Me.calendar_start.ItemData(ctr) =
Format(Me.calendar_start.Value, "hh:mm AMPM")
ctr = ctr + 1
Loop

With Me.calendar_start
.Value = .ItemData(ctr)
End With

and Access cries that I can't set the value of the object.

Please help...this has been driving me crazy for over 2 days.

Any help would be appreciated.

I'm not sure I see what you're trying to do. If the combo box is bound
to a field in the form's recordsource, then the combo box will
automatically display that value as move from record to record, and when
you drop it down the currently selected item *will* be highlighted. I
must be missing something.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top