473,783 Members | 2,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataCombo problem

R
Hi, I'm really stuck here.
I have a data combo called cmbHvem which I link to a recordset RS23 like
this

If RS23.State = adStateOpen Then
cmbHvem.RowSour ce = Nothing

RS23.Close()

End If

SQL = "SELECT AID,(FNavn + ' ' + ENavn) AS Ans FROM Ansatte WHERE KID = '" &
varKID & "'"

RS23.let_Source (SQL)

RS23.Open()

cmbHvem.RowSour ce = RS23

cmbHvem.BoundCo lumn = "AID"

cmbHvem.ListFie ld = "Ans"

To get the employees from the selected contact.

Then I want to set the combo value to one particular employee

I get a value from another query, RS1, and try this

cmbHvem.BoundTe xt = RS1.Fields("AID ").Value

This works once, this is part of a code on a "Dialog-form-box", the next
time I open the same dialog, the code is not working.

The value of RS1.Fields("AID ").Value is like 115, but the combo is not
changing to record 115.

Helppppp

Ronny
Nov 20 '05 #1
6 3867
R
I forgot to mention that the code below worked in VB6, when I try to move to
VB.NET I get this error.
Should I do somthing before closing the second form?

Ronny

"R" <r@u.com> wrote in message news:vc******** **********@news 2.e.nsc.no...
Hi, I'm really stuck here.
I have a data combo called cmbHvem which I link to a recordset RS23 like
this

If RS23.State = adStateOpen Then
cmbHvem.RowSour ce = Nothing

RS23.Close()

End If

SQL = "SELECT AID,(FNavn + ' ' + ENavn) AS Ans FROM Ansatte WHERE KID = '" & varKID & "'"

RS23.let_Source (SQL)

RS23.Open()

cmbHvem.RowSour ce = RS23

cmbHvem.BoundCo lumn = "AID"

cmbHvem.ListFie ld = "Ans"

To get the employees from the selected contact.

Then I want to set the combo value to one particular employee

I get a value from another query, RS1, and try this

cmbHvem.BoundTe xt = RS1.Fields("AID ").Value

This works once, this is part of a code on a "Dialog-form-box", the next
time I open the same dialog, the code is not working.

The value of RS1.Fields("AID ").Value is like 115, but the combo is not
changing to record 115.

Helppppp

Ronny

Nov 20 '05 #2
Cor
Hi R,

This is a VB.net language newsgroup, in VB.net is normaly either a datacombo
or a recordset used.

For that you probably get a better answer in one of the classic VB
newsgroups

microsoft.publi c.vb

I hope you find your solution.

Cor
Nov 20 '05 #3
Hey, Cor don't be so territorial
is a valid question
jc

"Cor" <no*@non.com> wrote in message
news:u2******** ******@tk2msftn gp13.phx.gbl...
Hi R,

This is a VB.net language newsgroup, in VB.net is normaly either a datacombo or a recordset used.

For that you probably get a better answer in one of the classic VB
newsgroups

microsoft.publi c.vb

I hope you find your solution.

Cor

Nov 20 '05 #4
Cor
Hi Jose,

It is the best answer I had and when I was sended it I did not had the
message that it was an update. It did totaly look VB6. The update message
came with me at the same time as my own.
But correction than is no more possible.

Cor
Hey, Cor don't be so territorial
is a valid question
jc

Nov 20 '05 #5
R
Apology accepted :-)
Do you have an ansver? Anybody?
It is a VB.NET question, I just mentioned that it worked in vb6...
I have a suspicion that I do not close my for properly...

Ronny

"Cor" <no*@non.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi Jose,

It is the best answer I had and when I was sended it I did not had the
message that it was an update. It did totaly look VB6. The update message
came with me at the same time as my own.
But correction than is no more possible.

Cor
Hey, Cor don't be so territorial
is a valid question
jc


Nov 20 '05 #6
Cor
Hi R,

You can try the newsgroup

microsoft.publi c.dotnet.langua ges.vb.upgrade

Mostly Herfried does not want to help with this kind of question here, but
he sometimes do that in that newsgroup (and maybe because I write it here
you are lucky and he does it here)

:-)).

But using those controls stays a problem, I think that it is better that
when you have a problem to change directly to real dotnet controls.

The datacombo does not exist but the combobox is a good replacement I think.
(It is the most buggiest control from Dotnet in my opinon but very good
usable).

To bind a datasource to a combobox is real very easy.

And when you have luck and have I written something wrong above because I do
not know so much anymore from VB6 and than Herfried corrects it.

:-)

But I hope this helps anyhow?

Cor
Nov 20 '05 #7

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

Similar topics

2
4973
by: Hmmm... | last post by:
Is there a way to control which controls appear to be "on top". For example a MaskEdBox shows up "on top" of a ComboBox when the 2 controls overlap, but a MaskedBox shows up "underneath" a DataCombo when 2 controls overlap. How can I force a MaskEdBox to show up "on top" of a DataCombo when whey overlap? Thanks.
117
7268
by: Peter Olcott | last post by:
www.halting-problem.com
28
5223
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass(); .... and then call the virtual method, why is it that the base class's method is called instead of the overridden method? How do I fix this if I don't know at runtime what the child class is? I'm using Activator.CreateInstance() to load the...
6
3813
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is less than or equal to 1249 then no problem.
0
238
by: oaksong | last post by:
I've got a data combo with about 12 rows, of which only the first two are selectable! I put a label on the page below the datacombo and selecteditem.text will populate the list when I change the selection combo for either of the first two items, but not for any of the others. I'm using database objects to populate the Datacombo. The code is:
1
1896
by: Bookreader | last post by:
I'm using a datacombo box in an application. It works fine when someone has made a selction and I use: adodcClient.Recordset.Bookmark = dcClient.SelectedItem MsgBox "Client Selected: " & dcClient.SelectedItem client = adodcClient.Recordset.Fields(0).Value clientID = adodcClient.Recordset.Fields(1).Value When there is no client, the code generates an error as should.
0
1828
by: Akinyemi | last post by:
I am developing a database for a Payroll program. I store the names of employees in a DataCombo control. I use ADO to connect the fields to my Access Database. Instead of using a Find or Search Button to look for an employee name in the database , I want to use a DataCombo control so that when the user clicks on the name of an employee or selects an employee name in the DataCombo, all the fields in respect of the employee selected shoud be...
1
1841
by: hussainiyad | last post by:
Dear All, In my form i,v many tables for examples 1.(Table)supplier = SupId varchar(10) primary key,SupName(20) 2.(Table)Product = ItemNo varchar(10)Primary key,Descrp varchar(20),Price float,Qty int 3.(Table)Pinvoice=InvoiceNo int primary key, Pdate datetime,SupId varchar(10),SupName varchar(10),ItemNo varchar(10),Descrp varchar(20),Price int,Qty int
1
4193
by: sunilkds | last post by:
What is difference between datacombo box and simple combo box. what is combox.itemdata @ datacombo box I want complete information with example of datacombo box
0
9480
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
10147
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
10081
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
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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...
0
5378
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...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
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.