Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

Default Combo to Asterisk

This is killing me...I have a combo box that I bind to an "Access" stored procedure or query or what ever you want to call it, and its defaulting the value to the first item in the query, and not the asterisk.  I would like it to default it to the asterisk...I tried explicitly setting the default to asterisk and it didn't work....Any ideas?
0
ispcorp
Asked:
ispcorp
  • 3
  • 2
1 Solution
 
Steve BinkCommented:
This behavior is by design, and happens because your query does not return an asterisk as part of a record.  The idea behind your solution is to manually add the combobox items as a value list instead of a recordset, or find a way to include an "asterisk record" in your return, such as something like this:

SELECT "*" as MyField
UNION
SELECT MyField FROM MyTable

That would have a single-field record ("*") merged with the rest of the records returned.
0
 
Steve BinkCommented:
0
 
ispcorpAuthor Commented:
Actually, I solved this one on my own...Turns out there was a table that looks up what the user saved as default picks for there fields on the form.  A query looks up those defaults and sets them accordingly on the form.  I set the the combo box in question to have a default of "*" on the table, and it worked fine.  Thanks any way.
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
Steve BinkCommented:
From OP
>>> I tried explicitly setting the default to asterisk and it didn't work

From most recent:
>>>  I set the the combo box in question to have a default of "*" on the table

Not saying I should get the points, even though I DID provide the questionner a link to a valid (and the 'accepted' solution), but I'm a little curious how his original fix all of a sudden worked.
0
 
ispcorpAuthor Commented:
Like I said there was table in the Access database that automatically set the default picks for the visual basic form, like for the combo box.  The table on the controlled the defaults because I found code that selected up against that table, which selected the item on the combo boxes.  It was feature added on so the user could save there settings for a search page.
0
 
CetusMODCommented:
PAQ'd, 500 points refunded.
CetusMOD
Community Support Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now