468,491 Members | 1,952 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,491 developers. It's quick & easy.

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 3704
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

117 posts views Thread by Peter Olcott | last post: by
28 posts views Thread by Jon Davis | last post: by
6 posts views Thread by Ammar | last post: by
reply views Thread by oaksong | last post: by
3 posts views Thread by gieforce | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.