473,386 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Combobox On A Custom Menubar

How do I create a combobox in a custom menubar to display months like:
1 January
2 February
3 March
etc

and then assign the month number (1, 2, 3, etc) of the selected month to a
textbox on a form?

Thanks for all help!

Judy

Nov 13 '05 #1
10 2176
Judy wrote:
How do I create a combobox in a custom menubar to display months like:
1 January
2 February
3 March
etc

and then assign the month number (1, 2, 3, etc) of the selected month to a
textbox on a form?


Create a table with those values and base the combobox on that table

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #2
But how do I create a combobox on a custom menubar? Then how do I get the
values in the table into the combobox and display the month name? Finally,
how do I assign the month number of the month selected to the textbox on a
form?

Judy
"Bas Cost Budde" <b.*********@heuvelqop.nl> wrote in message
news:co**********@news2.solcon.nl...
Judy wrote:
How do I create a combobox in a custom menubar to display months like:
1 January
2 February
3 March
etc

and then assign the month number (1, 2, 3, etc) of the selected month to a textbox on a form?


Create a table with those values and base the combobox on that table

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea

Nov 13 '05 #3
"Judy" <jr*******@notmyemail.com> wrote in message
news:M%*****************@newsread2.news.atl.earthl ink.net...
But how do I create a combobox on a custom menubar? Then how do I get the
values in the table into the combobox and display the month name? Finally,
how do I assign the month number of the month selected to the textbox on a
form?


Sub AddComboToMenu()

Dim Mnu As Object
Dim Cbo As Object

Set Mnu = CommandBars("MyMenuBar")
Set Cbo = Mnu.Controls.Add(4, 1)

With Cbo
.AddItem "January", 1
.AddItem "February", 2
.AddItem "March", 3
.AddItem "April", 4
.AddItem "May", 5
.AddItem "June", 6
.AddItem "July", 7
.AddItem "August", 8
.AddItem "September", 9
.AddItem "October", 10
.AddItem "November", 11
.AddItem "December", 12
End With

Set Cbo = Nothing
Set Mnu = Nothing

End Sub

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #4
Judy wrote:
But how do I create a combobox on a custom menubar? Then how do I get the
values in the table into the combobox and display the month name? Finally,
how do I assign the month number of the month selected to the textbox on a
form?


Sorry, I didn't read the menubar part. I see Rick addresses this aptly.

Why do you want that to be on a menubar, not on the form? I immediately
confess I haven't got the slightest experience with manipulating menu
bars; I have the feeling you can attach a general function to, say, the
Click event (the name will be different). In that function you could
examine Screen.Activeform (possibly even .ActiveControl) to determine
where to store the value.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #5
Rick,

Thank you for your response!

Where do I run the sub from? Does the combobox ever become permanent? Will
the combobox display just the month name? How do I assign the month number
of the selected month to a textbox on a form?

I am building a scheduling calendar form. To be readable, I made the
calendar take up the entire form. So I am creating a custom menu just for
that form to control the calendar.

Appreciate your help!

Judy

"Rick Brandt" <ri*********@hotmail.com> wrote in message
news:30*************@uni-berlin.de...
"Judy" <jr*******@notmyemail.com> wrote in message
news:M%*****************@newsread2.news.atl.earthl ink.net...
But how do I create a combobox on a custom menubar? Then how do I get the values in the table into the combobox and display the month name? Finally, how do I assign the month number of the month selected to the textbox on a form?


Sub AddComboToMenu()

Dim Mnu As Object
Dim Cbo As Object

Set Mnu = CommandBars("MyMenuBar")
Set Cbo = Mnu.Controls.Add(4, 1)

With Cbo
.AddItem "January", 1
.AddItem "February", 2
.AddItem "March", 3
.AddItem "April", 4
.AddItem "May", 5
.AddItem "June", 6
.AddItem "July", 7
.AddItem "August", 8
.AddItem "September", 9
.AddItem "October", 10
.AddItem "November", 11
.AddItem "December", 12
End With

Set Cbo = Nothing
Set Mnu = Nothing

End Sub

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #6
Thanks for your responses!

See my reply to Rick.

Judy
"Bas Cost Budde" <b.*********@heuvelqop.nl> wrote in message
news:co**********@news2.solcon.nl...
Judy wrote:
But how do I create a combobox on a custom menubar? Then how do I get the values in the table into the combobox and display the month name? Finally, how do I assign the month number of the month selected to the textbox on a form?


Sorry, I didn't read the menubar part. I see Rick addresses this aptly.

Why do you want that to be on a menubar, not on the form? I immediately
confess I haven't got the slightest experience with manipulating menu
bars; I have the feeling you can attach a general function to, say, the
Click event (the name will be different). In that function you could
examine Screen.Activeform (possibly even .ActiveControl) to determine
where to store the value.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea

Nov 13 '05 #7
"Judy" <jr*******@notmyemail.com> wrote in message
news:rg****************@newsread3.news.atl.earthli nk.net...
Rick,

Thank you for your response!

Where do I run the sub from? Does the combobox ever become permanent?
Just place in a standard module and run it. Once run the MenuBar will have the
ComboBox and it will be permanent.
Will the combobox display just the month name? How do I assign the month
number
of the selected month to a textbox on a form?


The numeric argument in my code is the index for each entry. I suppose your
could have a function that would return that. Otherwise you would need to have
code that provided the desired numeric value when fed the name of the month and
use that.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #8
Chuck,

Thanks for responding!

My calendar looks like a calendar and works just like a calendar allowing
the user to navigate to a selected year and month. For any selected year and
month, my calendar displays the courses scheduled for each day on the
calendar.

Judy
"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:l8********************************@4ax.com...
On Sat, 27 Nov 2004 17:59:51 GMT, "Judy" <jr*******@notmyemail.com>
wrote:
I am building a scheduling calendar form. To be readable, I made the
calendar take up the entire form. So I am creating a custom menu just for
that form to control the calendar.


Save yourself a *LOT* of trouble, and take a look at Steven's Calendar
demo:
<http://www.lebans.com/monthcalendar.htm>
--
A Wise Shepherd Never Trusts His Flock To A Smiling Wolf

Nov 13 '05 #9
Chuck,

Thanks for the info. Now that I have more info about Steven's calendar, I'll
look into it more. I'm well underway on mine and hope to have it working in
a few days. I'll send you a copy when done.

Judy
"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:ad********************************@4ax.com...

So does Steven's.

Take a serious look at it if you already haven't. I'd use it like
this:
Steven's form is what the user sees.
You can click on a date and have it populate a textbox on hidden
form, which causes Steven's calendar to disappear.
When the hidden form's date textbox changes (using the "On_change"
event, you open up another form, this one visible to the user, to
display all the data from the database that you want to display.

If you want the user to be able to select more then just a date, make
the form not a hidden form, but populated with whatever additional
selections you want or need to have (Locations, classes, instructors,
whatever).

Steven's calendar will also allow a user to select a range of dates,
so that you can program in something like "Find me a class within this
period." The only bug in it that I've been able to find is that the
user's range selection (highlighting a "group" of dates) is limited to
a single month. Other then that, it works like a charm!

But, it's your application. Do what you need to. I'd personally like
to see what you wind up with. I'm a bit of "nut" on calendars. I
have an application I run here on my personal computer that tells me
the date and what's happened on this date in about 25 different
calendars. It's just something I have for fun though...
On Sun, 28 Nov 2004 01:37:51 GMT, "Judy" <jr*******@notmyemail.com>
wrote:
My calendar looks like a calendar and works just like a calendar allowing
the user to navigate to a selected year and month. For any selected year andmonth, my calendar displays the courses scheduled for each day on the
calendar.

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:l8********************************@4ax.com.. .
On Sat, 27 Nov 2004 17:59:51 GMT, "Judy" <jr*******@notmyemail.com>
wrote:
>I am building a scheduling calendar form. To be readable, I made the
>calendar take up the entire form. So I am creating a custom menu just for >that form to control the calendar.

Save yourself a *LOT* of trouble, and take a look at Steven's Calendar
demo:
<http://www.lebans.com/monthcalendar.htm>

--
A Wise Monkey Never Monkies With Another Monkey's Monkey.

Nov 13 '05 #10
> Steven's calendar will also allow a user to select a range of dates,
so that you can program in something like "Find me a class within this
period." The only bug in it that I've been able to find is that the
user's range selection (highlighting a "group" of dates) is limited to
a single month. Other then that, it works like a charm!
Not a bug Chuck but an operator error!<grin>
The MonthCalendar class exposes a property to set the maximum number of
days allowed when selecting a range of dates. The default is 30. You can
set it to whatever you want!
:-)

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:ad********************************@4ax.com...
So does Steven's.

Take a serious look at it if you already haven't. I'd use it like
this:
Steven's form is what the user sees.
You can click on a date and have it populate a textbox on hidden
form, which causes Steven's calendar to disappear.
When the hidden form's date textbox changes (using the "On_change"
event, you open up another form, this one visible to the user, to
display all the data from the database that you want to display.

If you want the user to be able to select more then just a date, make
the form not a hidden form, but populated with whatever additional
selections you want or need to have (Locations, classes, instructors,
whatever).

Steven's calendar will also allow a user to select a range of dates,
so that you can program in something like "Find me a class within this
period." The only bug in it that I've been able to find is that the
user's range selection (highlighting a "group" of dates) is limited to
a single month. Other then that, it works like a charm!

But, it's your application. Do what you need to. I'd personally like
to see what you wind up with. I'm a bit of "nut" on calendars. I
have an application I run here on my personal computer that tells me
the date and what's happened on this date in about 25 different
calendars. It's just something I have for fun though...
On Sun, 28 Nov 2004 01:37:51 GMT, "Judy" <jr*******@notmyemail.com>
wrote:
My calendar looks like a calendar and works just like a calendar allowingthe user to navigate to a selected year and month. For any selected year andmonth, my calendar displays the courses scheduled for each day on the
calendar.

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:l8********************************@4ax.com.. .
On Sat, 27 Nov 2004 17:59:51 GMT, "Judy" <jr*******@notmyemail.com>
wrote:
>I am building a scheduling calendar form. To be readable, I made the >calendar take up the entire form. So I am creating a custom menu just for >that form to control the calendar.

Save yourself a *LOT* of trouble, and take a look at Steven's Calendar demo:
<http://www.lebans.com/monthcalendar.htm>

--
A Wise Monkey Never Monkies With Another Monkey's Monkey.


Nov 13 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jean | last post by:
hi: i am developing a custom combobox for my company's needs that is made up of a textbox, listbox, button. i am using c#. everything is fine except for one issue. in a normal combobox,...
7
by: Ian Hinson | last post by:
I have an Access app that has been distributed with run-time installation to many different customers over many years. It is developed in Access 2000. The custom menu bar has had no problems in...
0
by: metamedia | last post by:
How do I get a datagrid to register a data change from a custom control cell (combobox) I've got a Windows Application with a Windows Form Datagrid that has a custom combobox column. When the user...
5
by: ross kerr | last post by:
Hi All, I am extending the combobox to create a control that selects an item based on the text the user is typing into the text area of the control. I have an issue that occurs only when i...
9
by: Don | last post by:
Is there any way to detect when an item has been added to the Items collection of a combobox or listbox? I am inheriting a Combobox and want to validate items before they are added to the...
2
by: A.J. Pool | last post by:
I have a form with a main menubar containing a number of menu options. In the empty right half of the menubar I want to place a combobox where users can make some sort of selection. However, when...
5
by: Don | last post by:
I have a project wherein I derive a combobox and create a custom Populate() method for it to fill it with objects of a custom class I also created in a second project that the combobox project...
27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
6
by: Peter Larsen [CPH] | last post by:
Hi, How do i set DropDownWith in a asp.net ComboBox ?? Thank you in advance. BR Peter
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.