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 6 3840
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
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
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
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
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
by: Peter Olcott |
last post by:
www.halting-problem.com
|
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();...
|
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...
|
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...
|
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: " &...
|
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...
|
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...
|
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
|
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...
|
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...
|
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...
|
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 :...
|
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...
|
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...
|
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...
|
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...
|
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...
| |