472,954 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 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 3840
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
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.