473,765 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2211
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.*********@he uvelqop.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*******@notm yemail.com> wrote in message
news:M%******** *********@newsr ead2.news.atl.e arthlink.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("My MenuBar")
Set Cbo = Mnu.Controls.Ad d(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.Activefo rm (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*********@ho tmail.com> wrote in message
news:30******** *****@uni-berlin.de...
"Judy" <jr*******@notm yemail.com> wrote in message
news:M%******** *********@newsr ead2.news.atl.e arthlink.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("My MenuBar")
Set Cbo = Mnu.Controls.Ad d(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.*********@he uvelqop.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.Activefo rm (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*******@notm yemail.com> wrote in message
news:rg******** ********@newsre ad3.news.atl.ea rthlink.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.*******@worl dnet.att.net.in valid> wrote in message
news:l8******** *************** *********@4ax.c om...
On Sat, 27 Nov 2004 17:59:51 GMT, "Judy" <jr*******@notm yemail.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.h tm>
--
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.*******@worl dnet.att.net.in valid> wrote in message
news:ad******** *************** *********@4ax.c om...

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*******@notm yemail.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.*******@worl dnet.att.net.in valid> wrote in message
news:l8******* *************** **********@4ax. com...
On Sat, 27 Nov 2004 17:59:51 GMT, "Judy" <jr*******@notm yemail.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.h tm>

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

Nov 13 '05 #10

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

Similar topics

0
2063
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, when the dropdown is visible and the user clicks anywhere else, the dropdown gets hidden. i am trying to replicate this behavior and have tried using the Leave and LostFocus events. i have had marginal success when my dropdown is visible and i...
7
1729
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 the past. However on one new computer it was installed on last week the custom 'Tools' menu (which normally contains items such as 'Backup Data' and 'Preferences..' etc) has been replaced by a single menu item under Tools that says 'Other..'....
0
1539
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 clicks on a new row in the datagrid and tries to select or enter a new value in the combobox, the datagrid doesn't seem to register the change, so if the user tabs through the columns and onto the next row, the data is cleared and not saved Does...
5
2154
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 drop down the combo box as the users typing. When the on leave event is fired the value in the selected
9
7322
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 combobox, but I can't find anything that will let me do that. - Don
2
1471
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 I place a combobox on the form and move it to the menu area it disappaears behind the menubar, instead of appearing in front of it. How can I place the combobox on top of (or in front of) the menubar? I use VB.NET 2003 standard edition. --...
5
1212
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 references. This custom class has the ToString function overridden to display certain information. Everything worked fine until one day the combobox started displaying "AssemblyName.ClassName" (e.g. "MyProject.MyCustomClass") instead of the...
27
45564
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 height as they were in previous versions or will they be the "ribbon" style that takes up a huge portion of the screen? Also when I use Access 2007 to open an Access 2003 database that has custom menu bars they display as they did in Access...
6
2436
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
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10161
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.