473,416 Members | 1,730 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,416 software developers and data experts.

How to tell if there is no selection in a DataCombo box?

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.

I am trying to trap this error and handle it. I have gone through the
help and can't figure this out.

When I do this, I get the message without the index, which makes me
the the index IS NULL"
MsgBox "Selected Client = " & dc.SelectedItem

Then I try this:
If adodcOrders.Recordset.Index Is Null Then
MsgBox "Please select a client"
End If

I get:
Compile Error:
Type Mismatch
When I look at the code after the error, "Index" is highlighted in:
adodcOrders.Recordset.Index

Would someone please explain to me how to determine if a selection has
been made in the dataCombo please.

Thanks very much in advance.

Dec 11 '05 #1
1 1872
On Sun, 11 Dec 2005 01:44:21 GMT, Bookreader <bo***********@yahoo.com>
wrote:
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.

I am trying to trap this error and handle it. I have gone through the
help and can't figure this out.

When I do this, I get the message without the index, which makes me
the the index IS NULL"
MsgBox "Selected Client = " & dc.SelectedItem

Then I try this:
If adodcOrders.Recordset.Index Is Null Then
MsgBox "Please select a client"
End If

I get:
Compile Error:
Type Mismatch
When I look at the code after the error, "Index" is highlighted in:
adodcOrders.Recordset.Index

Would someone please explain to me how to determine if a selection has
been made in the dataCombo please.

Thanks very much in advance.

I meant to post this in the VB groups sorry.

Of course, I will appreciate any answers in this group as well.
Dec 11 '05 #2

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

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
15
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange)...
1
by: David | last post by:
Safari under Mac OSX accepts a "Execute Javascript" apple event. Thus, you can send an event to if from another application (or from the Scripts menu). I would like an event that does the...
6
by: BBFrost | last post by:
I'm using Net 1.1 (2003) SP1 & Windows 2000 Here's the issue ... Rows 12 thru 24 are selected in a datagrid. The user now unselects rows 12 thru 24 and selects rows 45 thru 70 ??? How can...
5
by: STeve | last post by:
Hey guys, I currently have a 100 page word document filled with various "articles". These articles are delimited by the Style of the text (IE. Heading 1 for the various titles) These articles...
6
by: R | last post by:
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
13
by: Jiho Han | last post by:
Here's the issue. You have a class, Class Person { public int id; public string firstname; public string lastname; }
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.