473,778 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what went wrong with my combo box?

GS
I got a combobox box that I load at load time. the Item and vales ended up
in reverse order of each other, what went wrong?
the database table has the following row
code value
ebay http://www.ebay.com
google http://www.google.com
yahoo http://www.yahoo.com
However in the drop down list
displayed value used
ebay http://www.yahoo.com
google http://www.google.com
yahoo http://www.google.com

here is the code listing for populating the combobox
Private Sub MainForm_Load(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim Conn As New SqlConnection(" Data
source=.\SQLEXP RESS;AttachDbFi leName=C:\myCtl .mdf;Integrated
Security=True;C onnect TimeOut=30;User Instance=True")
Using Conn
Dim queryString As String = "select code, value as Addr from
dbo.CodeTable where (codeTableName = 'FinCoUrl') And (sequence 0) order by
sequence"
Dim adapter As New SqlDataAdapter( )
adapter.SelectC ommand = New SqlCommand(quer yString, Conn)
Dim datatable As New DataTable
adapter.Fill(da tatable)

addressBar.Data Source = datatable.Defau ltView
addressBar.Disp layMember = "code"
addressBar.Valu eMember = "Addr"
End Using
WidthaddressBar = addressBar.Widt h
End Sub
the above code worked with a combox in another application . the only
diffference is the name

Is there some property on the combo I need to fix ?
Sep 7 '06 #1
1 1466
GS
still don't know what went wrong after comparing every attributes in
Designer.

hoping for luck, I just deleted the combobox and copy in the other combobox
in designer mode and renamed it to what the new application use. Voila, it
just works the way it should.

strange.
"GS" <gs************ **********@msne ws.Nomail.comwr ote in message
news:Oz******** ******@TK2MSFTN GP04.phx.gbl...
I got a combobox box that I load at load time. the Item and vales ended
up
in reverse order of each other, what went wrong?
the database table has the following row
code value
ebay http://www.ebay.com
google http://www.google.com
yahoo http://www.yahoo.com
However in the drop down list
displayed value used
ebay http://www.yahoo.com
google http://www.google.com
yahoo http://www.google.com

here is the code listing for populating the combobox
Private Sub MainForm_Load(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim Conn As New SqlConnection(" Data
source=.\SQLEXP RESS;AttachDbFi leName=C:\myCtl .mdf;Integrated
Security=True;C onnect TimeOut=30;User Instance=True")
Using Conn
Dim queryString As String = "select code, value as Addr from
dbo.CodeTable where (codeTableName = 'FinCoUrl') And (sequence 0) order
by
sequence"
Dim adapter As New SqlDataAdapter( )
adapter.SelectC ommand = New SqlCommand(quer yString, Conn)
Dim datatable As New DataTable
adapter.Fill(da tatable)

addressBar.Data Source = datatable.Defau ltView
addressBar.Disp layMember = "code"
addressBar.Valu eMember = "Addr"
End Using
WidthaddressBar = addressBar.Widt h
End Sub
the above code worked with a combox in another application . the only
diffference is the name

Is there some property on the combo I need to fix ?


Sep 8 '06 #2

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

Similar topics

10
3412
by: Greener | last post by:
Hi, I need help badly. Can you do client-side programming instead of server-side to capture the Browser type info? If this is the case, what's wrong with the following? <script language="JavaScript"> function doWord(file) { if (navigator.userAgent.indexOf("MSIE")!=-1)
6
2024
by: Rtritell | last post by:
Please can you find out what's wrong, fix the script and tell me what was wrong. Im just beginning <html> <head> <title>Random Mad Lib!</title> <script language="JavaScript"> <!-- Hide
7
3369
by: Vic | last post by:
Dear All, I found this code snippet on this list (taken from a nice webpage of a courteous fellow), which I used to filter a form on a combo box. I wanted to repeat the same code to have an additional combo control doing a different filtering on the same form, and simply copied the code below and changed the appropriate combo names. ______________________________________________________ Private Sub ExpByType_AfterUpdate() If...
3
2294
by: J | last post by:
I've moved the database tables from the .mdb file to Sql Svr and now I have an *intermittent* problem. When I select a record from a combo box, it will intermittently pull up the wrong record. The code that does the search is below. I have a column named 'ProsId' that is a unique number (identity column). The error -- when it happens -- seems to only happen on higher ProsId numbers. At first it appeared to me as some sort of data...
2
1257
by: khan | last post by:
SELECT Products.Manufacturere, Products.ProductDescription, Products.SerialNumber, Products.QtyOnHand, Products.Location FROM Products WHERE (((Products.Manufacturere)=!!) AND ((Products.SerialNumber)=!!)); cboSerial and cboManufacturer are combobox on my frmProducts I want when user select values in both combo box then he should be able to run query in the base of both combo box vale. but its not doing any thing.
6
1418
by: doncee | last post by:
This is the set up: is a date field on a form. Its control source is the field "date_entered" in"Table1". If there is a date showing in the date_entered field (Text6) & the status in Combo box2 shows "deleted" then the after update event should delete the date in Text6 & return the field "date_entered to a null value when the form is closed. Even though the debug window shows rst!date entered as null when you step through this event...
28
2938
by: federico_bertola | last post by:
Hi everybody! I have this function: int Scan(char String) { printf("%s", String); } it works but when I try to pass a dotted string o separetad with (" ", "_" , "-" ...ecc)
34
2500
by: radink | last post by:
Well, I've got my DB ready to go. Now what? I need to host it on our Win2003 server. How do clients use it? I think im getting more confused as I try to figure this out. We are a small company and I just want to be able to have everyone here use the database at the same time without too much fuss. Do I just have to have access on each machine and let them open it from the server, or is there more to it than that? I just don't want them...
12
1728
by: azalea45 | last post by:
Hi all I am a newbie when it comes to access. My company requires that all Databases run on the company SQL back-end as a result i have a Access project that connects to the server. I have two tables, table 1 called tblProjectDetails, table 2 called tblLearners The fields in tblProjectDetails are ProjectPK numeric (Its also the Primary Key)] Name char (50) Description char (50) There are other field but they dont play a role in the...
0
9628
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
9464
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10122
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...
1
10061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8954
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
7471
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
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
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.