Combo Box starting value

Hey there,
I have a combo box with values, with one value being "None"
How can I get this value to be the first one to show up in my combo box. Asc
and Desc are not doing it for me.
Thanks!

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1

0
gmazza
2/24/2010 11:41:54 PM
access.formscoding 7493 articles. 0 followers. Follow

5 Replies
935 Views

Similar Articles

[PageSpeed] 42

You don't mention how you are sorting the displayed values in your combobox.

You don't mention whether the combobox is based on a value list or on a 
query (or a table).

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

-- 
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"gmazza via AccessMonster.com" <u37142@uwe> wrote in message 
news:a4225252959ed@uwe...
> Hey there,
> I have a combo box with values, with one value being "None"
> How can I get this value to be the first one to show up in my combo box. 
> Asc
> and Desc are not doing it for me.
> Thanks!
>
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1
> 


0
Jeff
2/25/2010 12:23:26 AM
I depends on how you have set up your cbo.

One option is to add a column to your data source that has numeric value to 
sort on.

None   1
All       2
.....
-- 
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"gmazza via AccessMonster.com" wrote:

> Hey there,
> I have a combo box with values, with one value being "None"
> How can I get this value to be the first one to show up in my combo box. Asc
> and Desc are not doing it for me.
> Thanks!
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1
> 
> .
> 
0
Utf
2/25/2010 12:52:01 AM
"gmazza via AccessMonster.com" <u37142@uwe> wrote in message 
news:a4225252959ed@uwe...
> Hey there,
> I have a combo box with values, with one value being "None"
> How can I get this value to be the first one to show up in my combo box. 
> Asc
> and Desc are not doing it for me.
> Thanks!
>
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1

(None)

or <None>

will both sort to the top of the list.


0
Stuart
2/25/2010 1:28:58 AM
I have a query for my combo box and I am not currently sorting it at all. I
just want None to show up as the first choice.

Stuart McCall wrote:
>> Hey there,
>> I have a combo box with values, with one value being "None"
>> How can I get this value to be the first one to show up in my combo box. 
>> Asc
>> and Desc are not doing it for me.
>> Thanks!
>
>(None)
>
>or <None>
>
>will both sort to the top of the list.

-- 
Message posted via http://www.accessmonster.com

0
gmazza
2/25/2010 3:17:07 PM
"gmazza via AccessMonster.com" <u37142@uwe> wrote in message 
news:a42a7cf1e340e@uwe...
>I have a query for my combo box and I am not currently sorting it at all. I
> just want None to show up as the first choice.
>
> Stuart McCall wrote:
>>> Hey there,
>>> I have a combo box with values, with one value being "None"
>>> How can I get this value to be the first one to show up in my combo box.
>>> Asc
>>> and Desc are not doing it for me.
>>> Thanks!
>>
>>(None)
>>
>>or <None>
>>
>>will both sort to the top of the list.
>
> -- 
> Message posted via http://www.accessmonster.com
>

Well the only way I know of to achieve that without sorting is to change the 
combo's rowsource type to 'value list', then fill it from a recordset based 
on your query. That way you can put whatever you like as the 1st entry.

But I don't recommend it. It'll be slow compared to binding the combo to a 
field. Personally I'd set the sort order in the query and use parens to get 
None to the top.


0
Stuart
2/25/2010 6:31:34 PM
Reply:

Similar Artilces:

How do you get the attribute value using XPath in VB.Net 2003?
Hi, How do you get the attribute value using XPath in VB.Net 2003? Many thanks, aushknotes "aushknotes" <aushknotes@discussions.microsoft.com> wrote in message news:508426F2-1C8A-4AD2-A52E-B80B9798AC0C@microsoft.com... > Hi, > > How do you get the attribute value using XPath in VB.Net 2003? > Prefix @ to the name of the attribute value. XmlAttribute attrib = (XmlAttribute)dom.selectSingleNode("/path/@attributeName"); -- Anthony Jones - MVP ASP/ASP.NET aushknotes wrote: > How do you get the attribute value using XPath in VB.Net 2003? ...

How to change the string value in the registry?
How to change the "string value" in the registry from the code? As there is a functionality in my application that the user can change the "string value" with some GUI. But I m not able to change it as there is a function RegReplaceKey but its only to take the backup of old file and to replace it with new one and even i dont know how to use this functin to suit my case. RegSetValue/Ex() should do it I think. -Seetharam Look at the Registry APIs. Also, take a look at my Registry class on my MVP Tips site. joe On Sun, 26 Aug 2007 23:59:33 -0700, HItz <hitesh_im...

Getting rid of #value
How am I able to add a column of numbers when one of the numbers in the formula is itself a formula that results in #VALUE (because that number the product of zero times another number)? Thanks First, the product of zero and another number shouldn't be giving you #VALUE!. Your best bet is to fix or bypass whatever is causing the #VALUE! error. If you can't do that for some reason, array-enter (CTRL-SHIFT-ENTER or CMD-RETURN): =SUM(IF(ISERROR(A1:A20),"",A1:A20)) In article <_e6dnZvUCo7b1mHdRVn-sw@comcast.com>, "Craig" <jcstone1@comcast.net>...

Unable to Migrate Exchange 5.5 mail boxes to 2003 with the Migration Wizard
Hi, We are trying to migrate from and NT4 Domain with Exchange 5.5 to 2003/AD with Exchage 2003. We have the AD Domain set up. The NT4 Domain is still in place and on the same network, so our AD domain is similar but different (the "inc" has been dropped from the NetBIOS name). We have 2 Domain Controllers, and a brand new system to run Exchange 2003 on. It is clean, only has the OS and Exchange on it (we have problems when we get the critical updates. It seems linked to the exchange database going belly up, and we can't install exchange in the first place if the updates are ap...

'Counter' value of the 'Perflib' subkey
I have a program which queries the 'Counter' value of the 'Perflib' subkey in the Windows registry using RegQueryValueEx. It used to work fine but now the debug build of my program is broken on Windows 2008 Server R2. The 'Counter' value is a REG_MULTI_SZ type data and is terminated with two NULL characters. However, I found out for Windows 2008 Server R2, the value returned from RegQueryValueEx has an extra character(0xcdcd) after the two NULL characters, which ends the 'Counter' string value. And that extra character causes my program to fail ...

Combo Box problem 08-04-07
Why is my combo box in both the table and the bound form not accepting the hand-typed value and produces a "value not an item in the list" error even though I know for sure the value IS in the list? When I select the value from the list it wqorks fine and goes on to the next field.... Thanks Hi, Dennis. > Why is my combo box in both the table and the bound form not accepting the > hand-typed value and produces a "value not an item in the list" error even > though I know for sure the value IS in the list? No, the value _isn't_ in the list, because you ...

Exchange doesnt start at boot up problem.
Hi well here we go today for some reason exchange stopped and i mean totally we found out that asp and iis had totally disappeared?. So we re-install them and then re ran exchange with the disaster recovery switch. And everything seemed fine but how wrong i am. Ok so here we go:- Around 50 % of the users get an error message after send and recive 0x80040111 they recieve and send emails but the error appears these users are unable to send email through owa either. All other users are unaffected except for mac users using entourage they are unable to do anything at all (pop3). Also GFI stop...

Hide text box
I am trying to hide a text box on a subform if a check box is = to false. I am close in doing so, but not there yet. This is what I have In the AfterUpdate property of the check box I have the following: Private Sub RevisedGrant_AfterUpdate() If Me![RevisedGrant] = True Then If MsgBox("Are you sure you want to revise this grant?", vbYesNo) = vbNo Then Me![RevisedGrant] = False MsgBox "Grant will NOT be revised", vbOKOnly Forms![DataEntryFrm]![ItemSubFrm]![Total$ofItemsRequestedSubfrm].Form![Revised Total Approved].Visibl...

retrive value from lookup screen
hi, i hv small problem i make refrence for smartlist (SL)in GP form to enable me open the SL lookup form ,and i add lookup button to open that smart list but i want the retive value from SL to be inserted in text box exist on GP form please help me ...

VBA Combo Box
I have a combo box that I want to populate with a list of names. I do not want to reference names in the worksheet - using "RowSource" - I want to write the names in the code. I tried the following code: Private Sub ComboBox1_Change() With ComboBox1 ..RowSource = "" ..AddItem "Male" ..AddItem = "Female" End With End Sub This gives me an error. Does anyone know where the code should be added. Is this on a userform? If yes, then maybe it should be in the Userform_initialize procedure? If it's on a worksheet, maybe in the auto_open or workbook...

Adding Hyperlink to multiple values within a cell
My spreadsheet contains a list of people. The cell next to each nam contains multiple numeric values for identifying a specific piece o information. I would like to be able to click on one of those number (value) and a comment window pop up with the information associate with it, or be hyperlinked to the information further down th speadsheet. I want to avoid using multiple cells for this. Is this possible? Thank -- t2tru ----------------------------------------------------------------------- t2true's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=387 View this...

List Box no displaying added choices
I have several drop-down list boxes in a few forms that I am having trouble with. When I originally set up the database, I created the tables and entered a few items to be included in the drop down list in the lookup section of the table (design view). I then created the forms and inserted those fields. I have since added several new choices to the drop-down list of the table, and those new selections are available in the Table, but they are not available in the Form. The only items available in the drop down list on the Form are those choices that were originally there when I set up the fo...

Print dialog box using VBA in excel
Hi Everyone, I like to add a print button (that will select several worksheets and print them) in my excel worksheet. I have recorded my action using the macro recorder the problem is I can't select the printer everytime I run the macro it print in the background without asking the user to select the printer and uses the default printer. Can anyone help?? I just want the user to be able to select the desired printer every time before printing. My current code: Sub Print_All() Sheets(Array("Sheet 1", "Sheet 2", "Sheet 3", "Sheet 5)).Select 'intent...

CLick on Box to enter time of day
I have a worksheet where payment is entered in column C. I would like to use Column B as a time stamp. In other words as soon as data is entered in C5 then the exact time comes up in B5. When data is entered in C6 then the exact time cones up in C5. I do not want this time to change even when the page is saved and opened later on. Elfego You can enter a static time in a cell by hitting CTRL + SHIFT + ;(semi-colon) You could also use event code to enter a static date when you enter something in a cell. Private Sub Worksheet_Change(ByVal Target As Excel.Range) 'when entering data in ...

Cannot Start Microsoft outlook. #2
Dear friends, This is the first time I join this community. My purpose join the community is to look for an answer. I got problem with my computer running windows XP with the XP office application. Just a view moment ago, I cannot start my microsoft outlook. Why this is happend? The pop up screen shot saying: 1. It say I must create profile. I don't want to create new profile due I already had it. then I click cancel button. 2. Then the next pop up screen say: 'No profile has been created' 3. Then the last pop up screen say: 'Cannot start Microsoft Outlook. The server...

Removing gray shading in protected forms (drop down box)
Hello- I am creating some contract templates for my company's sales force using Word 2003. I am using the forms toolbar to insert checkboxes and drop down boxes from which to select deliverable specifications. The problem is that when a user selects an option from the drop down box, the gray shading remains. I know the sales teams HATE the gray shading because they don't think it looks very good when sending to customers. Is there a way to disable the shading when an option is selected? Thanks. You can remove form field shading altogether using the corresponding b...

Combo values from query based on form fields
I am setting the values for a combo box in a form(s) via a query that 'filters' the results with criteria based upon the values of other fields on the form. The combo is a field that is bound. However, this is giving all kinds of problems ranging from Access completely crashing to being asked for the parameter values of those criteria fields when closing the form. I have tried making the combo an unbound field and then setting the value of the bound field to that unbound field after update, but that still leads to the same issues. How can I do this? As example - I have a form w...

Duplicate message box
Hi... Can u pls.anybody suggest for my below query..? My query is.... I set Primary key for 4 field together as i need to check duplicate values for these 4 field. When i enter the data into the form, it restricts to enter the duplicate values by giving the below message. "The changes you requested to the table were not successful because they would create duplicate values in the index,primary key, or relationship. Change the data in the field or fields thagt contain duplicate data,remove the index,or redefine the index to permit duplicate entries and try again." But, i ne...

Add values in a column according to value in another column
How can I add the values in a column according to values in another column? If there is any value in a row in column B, I want to include the value of the corresponding row in column A. I'm flexible as to whether this is ANY value (i.e. not empty) or greater than zero. Hi Paul Maybe something like this =IF(B1="","",IF(B1>0,B1+A1)) Regards Cimjet "Paul Kaye" <paulmjkaye@gmail.com> wrote in message news:05befaf3-9ba8-48c8-aebb-654f0269d1dc@34g2000hsf.googlegroups.com... > How can I add the values in a column according to values in another > colu...

lookup value based on multiple criteria
Banging my head on this one... can anyone help?? I've got several thousand rows of data in three columns, structured similar to example below. Each set of ID numbers represents a separate contact entry (person) in an address book. FIELDNAME could include one or more of about 200 fields, and VALUE may be blank. ID FIELDNAME VALUE 1 FirstName Bob 1 LastName Smith 1 Company Tech Smith, Inc. 2 LastName Johnson 2 Company <blank> 2 FirstName Jim I've got a second sheet set up with all of the 200 possible FIEL...

text box outline
In my text box, I can click on the text and a square dotted blue line that surrounds the text. I can then click on some other text and the same thing happens. How can I remove the Blue line. It seems to be in the edit mode but I have even saved it and locked it (protect) mode. Still has to blue outline. Help! and Thanks The dotted blue line is to show you the Text Box boundary for when you don't have a printable formatted and View Text Boundaries are set to OFF. Does pressing the ESCAPE key hide them? But they should clear when you move the cursor elsewhere. If they...

List records that do not include specified value
I have a very basic select query that list all the records from a table SELECT tbl_cngu.cngu_no, tbl_cngu_recalls.recall_no FROM tbl_cngu LEFT JOIN tbl_cngu_recalls ON tbl_cngu.cngu_no = tbl_cngu_recalls.cngu_no ORDER BY tbl_cngu.cngu_no, tbl_cngu_recalls.recall_no DESC; Now I need to apply a twist and do no know how. The [recall_no] field is a numeric field 1,2,3,4,5,... and what I would like to do is supply the query with a [recall_no] value and have the query return those records for which there is no such [recall_no] for a each given [cngu_no]. How would I do this? T...

text length in a text box versus memo field
I have created a reoprt that uses a memo field. The problem I am having is that not all of the text in the memo field is showing up in the txtbox of the report. I have set the properties of the report field (data source qry!memofield) to can grow "yes" and have made the text field larger than needed on the report, but when I preview the Report or print it the text box in question only shows 202 charactures/spaces out of 310 in the tables memo field. How can I get the report to show and print all the information from the memo field. Could my text length be limited to the fact ...

Populating a list box
I am trying to populate a list box with data from an Access table. I added the list box field to a Great Plains form (and to the VB project) and am trying to get the VBA code to work. The code to open the Access table works fine but the AddItem method code bombs and returns Run-time error 438. Object doesn't support this property or method. Here's the code: Do Until rstSalAdjCode.EOF cboReason.AddItem (rstSalAdjCode(0)) 'Code bombs on this line rstSalAdjCode.MoveNext Loop Anyone know what I'm doing wrong here? Thanks. You cannot add items to a gplist bo...

Copy Macro values to new sheet
I have a macro which creates a text file to an new excel document. I have placed within this macro a function to put a button on this sheet, the thing is, is that I can't find away to import the code needed for this button to the sheet If you know, can you help me please -- Message posted via http://www.officekb.com ...