473,320 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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.RowSource = Nothing

RS23.Close()

End If

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

RS23.let_Source(SQL)

RS23.Open()

cmbHvem.RowSource = RS23

cmbHvem.BoundColumn = "AID"

cmbHvem.ListField = "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.BoundText = 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 3852
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******************@news2.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.RowSource = Nothing

RS23.Close()

End If

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

RS23.let_Source(SQL)

RS23.Open()

cmbHvem.RowSource = RS23

cmbHvem.BoundColumn = "AID"

cmbHvem.ListField = "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.BoundText = 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.public.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**************@tk2msftngp13.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.public.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****************@TK2MSFTNGP09.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.public.dotnet.languages.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
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...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
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();...
6
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...
0
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...
1
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: " &...
0
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...
1
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...
1
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.