Drop-Down List (ComboBox) and Text Box questions
Author |
Message |
Jule #1 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
I have created a drop-down list and used the additem method in VBA to fill the list with values. What I am wondering is if there is any way to disable the entry of text into the combo box? Also I am trying to insert default date values in to text boxes but i would like the format to remain consistent as well. I cannot seem to figure out how to do this. Can some please help?? BTW I am using Word 2000. TIA Jules
|
Tue, 08 Feb 2005 22:38:59 GMT |
|
 |
Jay Freedma #2 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
Hi, Jules, In the Property list for the combo box, set the MatchRequired property to True. Alternatively, include a line like this in the Userform_Initialize procedure: ComboBox1.MatchRequired = True To format dates, do something like this: TextBox1.Text = Format(Date, "MMMM dd, yyyy") Look up the Format function in VBA help to see how the formatting string works. -- Regards, Jay Freedman Microsoft Word MVP Word MVP FAQ site: http://www.mvps.org/word Quote:
> I have created a drop-down list and used the additem > method in VBA to fill the list with values. What I am > wondering is if there is any way to disable the entry of > text into the combo box? > Also I am trying to insert default date values in to text > boxes but i would like the format to remain consistent as > well. I cannot seem to figure out how to do this. Can > some please help?? > BTW I am using Word 2000. > TIA > Jules
|
Wed, 09 Feb 2005 00:39:19 GMT |
|
 |
Jule #3 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
I already have the matchrequired set to true. The problem is the default error message is invlaid property value. What would i have to do to modify this so that i could either change the message? or disable editting the box so that the end-user could not modify the contents? Thanks for the help, Jules Quote: >-----Original Message----- >Hi, Jules, >In the Property list for the combo box, set the
MatchRequired property Quote: >to True. Alternatively, include a line like this in the >Userform_Initialize procedure: > ComboBox1.MatchRequired = True >To format dates, do something like this: > TextBox1.Text = Format(Date, "MMMM dd, yyyy") >Look up the Format function in VBA help to see how the formatting string >works. >-- >Regards, >Jay Freedman >Microsoft Word MVP Word MVP FAQ site:
http://www.mvps.org/word Quote:
>> I have created a drop-down list and used the additem >> method in VBA to fill the list with values. What I am >> wondering is if there is any way to disable the entry of >> text into the combo box? >> Also I am trying to insert default date values in to text >> boxes but i would like the format to remain consistent as >> well. I cannot seem to figure out how to do this. Can >> some please help?? >> BTW I am using Word 2000. >> TIA >> Jules >.
|
Wed, 09 Feb 2005 00:50:01 GMT |
|
 |
Jay Freedma #4 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
Hi, Jules, Ahh, that's different. Use this: ComboBox1.Style = fmStyleDropDownList or set the property at design time. That disables editing in the box. You probably also want to set ComboBox1.MatchEntry = fmMatchEntryFirstLetter Then, pressing letter keys makes the entry in the box jump to the next value in the list that starts with that letter. If there are no entries starting with that letter, nothing happens. -- Regards, Jay Freedman Microsoft Word MVP Word MVP FAQ site: http://www.mvps.org/word Quote:
> I already have the matchrequired set to true. The problem > is the default error message is invlaid property value. > What would i have to do to modify this so that i could > either change the message? or disable editting the box so > that the end-user could not modify the contents? > Thanks for the help, > Jules >> -----Original Message----- >> Hi, Jules, >> In the Property list for the combo box, set the MatchRequired >> property to True. Alternatively, include a line like this in the >> Userform_Initialize procedure: >> ComboBox1.MatchRequired = True >> To format dates, do something like this: >> TextBox1.Text = Format(Date, "MMMM dd, yyyy") >> Look up the Format function in VBA help to see how the formatting >> string works. >> -- >> Regards, >> Jay Freedman >> Microsoft Word MVP Word MVP FAQ site: http://www.mvps.org/word
>>> I have created a drop-down list and used the additem >>> method in VBA to fill the list with values. What I am >>> wondering is if there is any way to disable the entry of >>> text into the combo box? >>> Also I am trying to insert default date values in to text >>> boxes but i would like the format to remain consistent as >>> well. I cannot seem to figure out how to do this. Can >>> some please help?? >>> BTW I am using Word 2000. >>> TIA >>> Jules >> .
|
Wed, 09 Feb 2005 04:07:54 GMT |
|
 |
Jule #5 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
Thank you very much for the help that is exactly what i wanted to do. Jules
|
Fri, 11 Feb 2005 20:17:12 GMT |
|
 |
Jule #6 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
Ok I was wrong, thought this was exactly what I wanted. I am getting an error now that says "Could not set the Text property. Invalid property value." I have my combobox.listindex=0 Thanks again Quote: >-----Original Message----- >Hi, Jules, >Ahh, that's different. Use this: > ComboBox1.Style = fmStyleDropDownList >or set the property at design time. That disables editing in the box. >You probably also want to set > ComboBox1.MatchEntry = fmMatchEntryFirstLetter >Then, pressing letter keys makes the entry in the box jump to the next >value in the list that starts with that letter. If there are no entries >starting with that letter, nothing happens. >-- >Regards, >Jay Freedman >Microsoft Word MVP Word MVP FAQ site:
http://www.mvps.org/word Quote:
>> I already have the matchrequired set to true. The problem >> is the default error message is invlaid property value. >> What would i have to do to modify this so that i could >> either change the message? or disable editting the box so >> that the end-user could not modify the contents? >> Thanks for the help, >> Jules >>> -----Original Message----- >>> Hi, Jules, >>> In the Property list for the combo box, set the MatchRequired >>> property to True. Alternatively, include a line like this in the >>> Userform_Initialize procedure: >>> ComboBox1.MatchRequired = True >>> To format dates, do something like this: >>> TextBox1.Text = Format(Date, "MMMM dd, yyyy") >>> Look up the Format function in VBA help to see how the formatting >>> string works. >>> -- >>> Regards, >>> Jay Freedman >>> Microsoft Word MVP Word MVP FAQ site:
http://www.mvps.org/word Quote:
>>>> I have created a drop-down list and used the additem >>>> method in VBA to fill the list with values. What I am >>>> wondering is if there is any way to disable the entry of >>>> text into the combo box? >>>> Also I am trying to insert default date values in to text >>>> boxes but i would like the format to remain consistent as >>>> well. I cannot seem to figure out how to do this. Can >>>> some please help?? >>>> BTW I am using Word 2000. >>>> TIA >>>> Jules >>> . >.
|
Fri, 11 Feb 2005 21:29:49 GMT |
|
 |
Jay Freedma #7 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
What are you doing when that error occurs? If you're given the chance to go into the de{*filter*}, what line is highlighted? (Paste the surrounding section of the code into your message and point to the highlighted line.) -- Regards, Jay Freedman Microsoft Word MVP Word MVP FAQ site: http://www.*-*-*.com/ Quote:
> Ok I was wrong, thought this was exactly what I wanted. I > am getting an error now that says "Could not set the Text > property. Invalid property value." > I have my combobox.listindex=0 > Thanks again >> -----Original Message----- >> Hi, Jules, >> Ahh, that's different. Use this: >> ComboBox1.Style = fmStyleDropDownList >> or set the property at design time. That disables editing in the box. >> You probably also want to set >> ComboBox1.MatchEntry = fmMatchEntryFirstLetter >> Then, pressing letter keys makes the entry in the box jump to the >> next value in the list that starts with that letter. If there are no >> entries starting with that letter, nothing happens. >> -- >> Regards, >> Jay Freedman >> Microsoft Word MVP Word MVP FAQ site: http://www.*-*-*.com/
>>> I already have the matchrequired set to true. The problem >>> is the default error message is invlaid property value. >>> What would i have to do to modify this so that i could >>> either change the message? or disable editting the box so >>> that the end-user could not modify the contents? >>> Thanks for the help, >>> Jules >>>> -----Original Message----- >>>> Hi, Jules, >>>> In the Property list for the combo box, set the MatchRequired >>>> property to True. Alternatively, include a line like this in the >>>> Userform_Initialize procedure: >>>> ComboBox1.MatchRequired = True >>>> To format dates, do something like this: >>>> TextBox1.Text = Format(Date, "MMMM dd, yyyy") >>>> Look up the Format function in VBA help to see how the formatting >>>> string works. >>>> -- >>>> Regards, >>>> Jay Freedman >>>> Microsoft Word MVP Word MVP FAQ site: >>>> http://www.*-*-*.com/
>>>>> I have created a drop-down list and used the additem >>>>> method in VBA to fill the list with values. What I am >>>>> wondering is if there is any way to disable the entry of >>>>> text into the combo box? >>>>> Also I am trying to insert default date values in to text >>>>> boxes but i would like the format to remain > consistent as >>>>> well. I cannot seem to figure out how to do this. Can >>>>> some please help?? >>>>> BTW I am using Word 2000. >>>>> TIA >>>>> Jules >>>> . >> .
|
Sat, 12 Feb 2005 00:28:37 GMT |
|
 |
Jule #8 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
I am just trying to run my form. I don't have it going into the de{*filter*} and it only occurs after this is changed ComboBox1.Style = fmStyleDropDownList Quote: >-----Original Message----- >What are you doing when that error occurs? If you're given the chance to >go into the de{*filter*}, what line is highlighted? (Paste the surrounding >section of the code into your message and point to the highlighted >line.) >-- >Regards, >Jay Freedman >Microsoft Word MVP Word MVP FAQ site:
http://www.*-*-*.com/ Quote:
>> Ok I was wrong, thought this was exactly what I wanted. I >> am getting an error now that says "Could not set the Text >> property. Invalid property value." >> I have my combobox.listindex=0 >> Thanks again >>> -----Original Message----- >>> Hi, Jules, >>> Ahh, that's different. Use this: >>> ComboBox1.Style = fmStyleDropDownList >>> or set the property at design time. That disables editing in the box. >>> You probably also want to set >>> ComboBox1.MatchEntry = fmMatchEntryFirstLetter >>> Then, pressing letter keys makes the entry in the box jump to the >>> next value in the list that starts with that letter. If there are no >>> entries starting with that letter, nothing happens. >>> -- >>> Regards, >>> Jay Freedman >>> Microsoft Word MVP Word MVP FAQ site:
http://www.*-*-*.com/ Quote:
>>>> I already have the matchrequired set to true. The problem >>>> is the default error message is invlaid property value. >>>> What would i have to do to modify this so that i could >>>> either change the message? or disable editting the box so >>>> that the end-user could not modify the contents? >>>> Thanks for the help, >>>> Jules >>>>> -----Original Message----- >>>>> Hi, Jules, >>>>> In the Property list for the combo box, set the MatchRequired >>>>> property to True. Alternatively, include a line like this in the >>>>> Userform_Initialize procedure: >>>>> ComboBox1.MatchRequired = True >>>>> To format dates, do something like this: >>>>> TextBox1.Text = Format(Date, "MMMM dd, yyyy") >>>>> Look up the Format function in VBA help to see how the formatting >>>>> string works. >>>>> -- >>>>> Regards, >>>>> Jay Freedman >>>>> Microsoft Word MVP Word MVP FAQ site: >>>>> http://www.*-*-*.com/
>>>>>> I have created a drop-down list and used the additem >>>>>> method in VBA to fill the list with values. What I am >>>>>> wondering is if there is any way to disable the entry of >>>>>> text into the combo box? >>>>>> Also I am trying to insert default date values in to text >>>>>> boxes but i would like the format to remain >> consistent as >>>>>> well. I cannot seem to figure out how to do this. Can >>>>>> some please help?? >>>>>> BTW I am using Word 2000. >>>>>> TIA >>>>>> Jules >>>>> . >>> . >.
|
Sat, 12 Feb 2005 00:44:34 GMT |
|
 |
Jay Freedma #9 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
Do you have any code in the form that tries to assign a value to the .Text property of any combo box? It's very hard to tell what's going on when you don't give me any code to look at... -- Regards, Jay Freedman Microsoft Word MVP Word MVP FAQ site: http://www.*-*-*.com/ Quote:
> I am just trying to run my form. I don't have it going > into the de{*filter*} and it only occurs after this is changed > ComboBox1.Style = fmStyleDropDownList >> -----Original Message----- >> What are you doing when that error occurs? If you're given the >> chance to go into the de{*filter*}, what line is highlighted? (Paste the >> surrounding section of the code into your message and point to the >> highlighted line.) >> -- >> Regards, >> Jay Freedman >> Microsoft Word MVP Word MVP FAQ site: http://www.*-*-*.com/
>>> Ok I was wrong, thought this was exactly what I > wanted. I >>> am getting an error now that says "Could not set the Text >>> property. Invalid property value." >>> I have my combobox.listindex=0 >>> Thanks again >>>> -----Original Message----- >>>> Hi, Jules, >>>> Ahh, that's different. Use this: >>>> ComboBox1.Style = fmStyleDropDownList >>>> or set the property at design time. That disables editing in the >>>> box. You probably also want to set >>>> ComboBox1.MatchEntry = fmMatchEntryFirstLetter >>>> Then, pressing letter keys makes the entry in the box jump to the >>>> next value in the list that starts with that letter. > If there are no >>>> entries starting with that letter, nothing happens. >>>> -- >>>> Regards, >>>> Jay Freedman >>>> Microsoft Word MVP Word MVP FAQ site: >>>> http://www.*-*-*.com/
>>>>> I already have the matchrequired set to true. The problem >>>>> is the default error message is invlaid property value. >>>>> What would i have to do to modify this so that i could >>>>> either change the message? or disable editting the > box so >>>>> that the end-user could not modify the contents? >>>>> Thanks for the help, >>>>> Jules >>>>>> -----Original Message----- >>>>>> Hi, Jules, >>>>>> In the Property list for the combo box, set the MatchRequired >>>>>> property to True. Alternatively, include a line like this in the >>>>>> Userform_Initialize procedure: >>>>>> ComboBox1.MatchRequired = True >>>>>> To format dates, do something like this: >>>>>> TextBox1.Text = Format(Date, "MMMM dd, yyyy") >>>>>> Look up the Format function in VBA help to see how the formatting >>>>>> string works. >>>>>> -- >>>>>> Regards, >>>>>> Jay Freedman >>>>>> Microsoft Word MVP Word MVP FAQ site: >>>>>> http://www.*-*-*.com/
>>>>>>> I have created a drop-down list and used the additem >>>>>>> method in VBA to fill the list with values. What I am >>>>>>> wondering is if there is any way to disable the entry of >>>>>>> text into the combo box? >>>>>>> Also I am trying to insert default date values in > to text >>>>>>> boxes but i would like the format to remain consistent as >>>>>>> well. I cannot seem to figure out how to do this. Can >>>>>>> some please help?? >>>>>>> BTW I am using Word 2000. >>>>>>> TIA >>>>>>> Jules >>>>>> . >>>> . >> .
|
Sat, 12 Feb 2005 02:32:32 GMT |
|
 |
Jule #10 / 10
|
 Drop-Down List (ComboBox) and Text Box questions
Thank you I just figured that out it was exactly what I did. I used debug.print statements toi determine where my problem was and i was trying to assign a text value to the dropdown list. Thanks for all your help on this ordered a book on word VBA but waiting for it to come in. Thanks to you I may not need it now. All the major problems I have been having are now solved. Jules Quote: >-----Original Message----- >Do you have any code in the form that tries to assign a value to the >..Text property of any combo box? >It's very hard to tell what's going on when you don't give me any code >to look at... >-- >Regards, >Jay Freedman >Microsoft Word MVP Word MVP FAQ site:
http://www.*-*-*.com/ Quote:
>> I am just trying to run my form. I don't have it going >> into the de{*filter*} and it only occurs after this is changed >> ComboBox1.Style = fmStyleDropDownList >>> -----Original Message----- >>> What are you doing when that error occurs? If you're given the >>> chance to go into the de{*filter*}, what line is
highlighted? (Paste the Quote: >>> surrounding section of the code into your message and point to the >>> highlighted line.) >>> -- >>> Regards, >>> Jay Freedman >>> Microsoft Word MVP Word MVP FAQ site:
http://www.*-*-*.com/ Quote:
>>>> Ok I was wrong, thought this was exactly what I >> wanted. I >>>> am getting an error now that says "Could not set the Text >>>> property. Invalid property value." >>>> I have my combobox.listindex=0 >>>> Thanks again >>>>> -----Original Message----- >>>>> Hi, Jules, >>>>> Ahh, that's different. Use this: >>>>> ComboBox1.Style = fmStyleDropDownList >>>>> or set the property at design time. That disables editing in the >>>>> box. You probably also want to set >>>>> ComboBox1.MatchEntry = fmMatchEntryFirstLetter >>>>> Then, pressing letter keys makes the entry in the box jump to the >>>>> next value in the list that starts with that letter. >> If there are no >>>>> entries starting with that letter, nothing happens. >>>>> -- >>>>> Regards, >>>>> Jay Freedman >>>>> Microsoft Word MVP Word MVP FAQ site: >>>>> http://www.*-*-*.com/
>>>>>> I already have the matchrequired set to true. The problem >>>>>> is the default error message is invlaid property value. >>>>>> What would i have to do to modify this so that i could >>>>>> either change the message? or disable editting the >> box so >>>>>> that the end-user could not modify the contents? >>>>>> Thanks for the help, >>>>>> Jules >>>>>>> -----Original Message----- >>>>>>> Hi, Jules, >>>>>>> In the Property list for the combo box, set the MatchRequired >>>>>>> property to True. Alternatively, include a line like this in the >>>>>>> Userform_Initialize procedure: >>>>>>> ComboBox1.MatchRequired = True >>>>>>> To format dates, do something like this: >>>>>>> TextBox1.Text = Format(Date, "MMMM dd, yyyy") >>>>>>> Look up the Format function in VBA help to see how the formatting >>>>>>> string works. >>>>>>> -- >>>>>>> Regards, >>>>>>> Jay Freedman >>>>>>> Microsoft Word MVP Word MVP FAQ site: >>>>>>> http://www.*-*-*.com/
>>>>>>>> I have created a drop-down list and used the additem >>>>>>>> method in VBA to fill the list with values. What I am >>>>>>>> wondering is if there is any way to disable the entry of >>>>>>>> text into the combo box? >>>>>>>> Also I am trying to insert default date values in >> to text >>>>>>>> boxes but i would like the format to remain consistent as >>>>>>>> well. I cannot seem to figure out how to do this. Can >>>>>>>> some please help?? >>>>>>>> BTW I am using Word 2000. >>>>>>>> TIA >>>>>>>> Jules >>>>>>> . >>>>> . >>> . >.
|
Sat, 12 Feb 2005 02:40:34 GMT |
|
|
|