473,699 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

listbox problem

Dear All,

Selecting 1 order in a listbox by code. Works OK, BUT
Opening a related form using Me.LstOrders.Co lumn(0) as criteriavalue
sometimes triggers an error:
'There was a problem accessing a property or methode of the OLE object'

MsgBox Me.LstOrders.It emsSelected.Cou nt
MsgBox "[ORD_ID]= " & Me.LstOrders.Co lumn(0)

When i insert these MsgBoxes before opening the form it shows:

1. If no error follows:
1
[ORD_ID]=1111
2. if error follow
1
[ORD_ID]=

In case 2 the selection is there but the value Me.LstOrders.Co lumn(0) is not
accessible.

But why is it sometimes not accessible.

Reselecting the order manualy solves the problem.

THANKS,
Nov 12 '05 #1
1 1715
Oh the joy of list boxes in Access - not a lot you can do except check to
see if the list box has a value in it before attempting to extract anything
from the Column property. This can be done by checking the listbox with
Isnull. For example:

If Not IsNull(lstOrder s) Then
MsgBox lstOrders.Colum n(0)
End If

But to answer your question, I've no idea why Access is so fickle with
listbox selection :-/

"Filips Benoit" <be***********@ pandora.be> wrote in message
news:VJ******** **************@ phobos.telenet-ops.be...
Dear All,

Selecting 1 order in a listbox by code. Works OK, BUT
Opening a related form using Me.LstOrders.Co lumn(0) as criteriavalue
sometimes triggers an error:
'There was a problem accessing a property or methode of the OLE object'

MsgBox Me.LstOrders.It emsSelected.Cou nt
MsgBox "[ORD_ID]= " & Me.LstOrders.Co lumn(0)

When i insert these MsgBoxes before opening the form it shows:

1. If no error follows:
1
[ORD_ID]=1111
2. if error follow
1
[ORD_ID]=

In case 2 the selection is there but the value Me.LstOrders.Co lumn(0) is not accessible.

But why is it sometimes not accessible.

Reselecting the order manualy solves the problem.

THANKS,

Nov 12 '05 #2

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

Similar topics

5
540
by: Brian | last post by:
Hi, All, I'm using MS.net 2003 and using a windows.forms.listbox control for my window application but I don't know why the Horizontal Scrollbar could NOT be shown even if I set HorizontalScrollbar = true. The text info in listbox already beyond its right edge. How can I see the hidden part info in listbox? here is a part of codes. ListBox.ValueMember = XX ListBox.DisplayMember = XXXX
5
3525
by: Bill | last post by:
I have have two list boxes. One is a listing of all possible variables. We'll call this listbox A. The other is a listing of all the selected variables. We'll call this listbox B. If a person double-clicks on one of the variables in listbox A it "moves" it to listbox B. What is going on behind the scenes is that the table that holds all these variables has a yes/no field call Print. When the user double clicks on the value it fires a...
2
3675
by: Simon P | last post by:
Hello group, I'm in desperate need of help. Here goes : I have the following tables : CONTACTS (ContactID, FirstName, LastName, Company, etc.), SHOWS (ShowID, ShowDescription) and SHOWDETAILS (links the previous tables together so not to have a many-to-many relationship -- has the ContactID and ShowID fields). I have a main form with a couple of listboxes which are used for querying the CONTACTS table. The results populate bound fields...
1
3210
by: Josema | last post by:
Hi to all, I have a class (persons) that derives from collection base: and another class (person) with this properties: -ID -Name When i have complete filled the object Persons with all the persons, i put each persons inside a ListBox following this:
1
2705
by: MrNobody | last post by:
Hi, I'm doing something where I add custom objects to a ListBox which have aToString() method overriden so it displays what I want. When adding instances of these custom objects to the ListBox I also put the same references in a Hashtable so my program can obtain and modify these objects without iterating through entire ListBox looking for what I want. The problem is though, when I update these objects the changes are not being reflected...
1
2262
by: yamne | last post by:
I have a problem. When I click in edit datagrid button I show two listbox and two button. I use two button to move data between two listbox. My problem is that I can't call the listbox in the button_click function because the only way to find the listbox is: (listbox)e.item.findcontrol What s the solution to this problem?
4
11495
by: Ron | last post by:
I've got a listbox that holds a list of groups. Users can select a group, hit the remove button and the group should be removed from the listbox. The only problem is that no matter which group you select, the first one in the listbox is always removed.(The listitem with an index of 0. Box is set to single selection mode) I've looked at multiple examples and they all do it this way. What's wrong? (variables are also being set to the values...
8
6379
by: nirdeshonline | last post by:
Hi, I have added a simple listbox in windows form under c# 2.0. It contains a collection of approx 10 strings as list items. Now when i resize the form whole listbox flickers. Please tell me any feasible solution, i need to use a checked listbox which also has same flickering problem on resize. Thanks & Regards
9
3224
by: zdrakec | last post by:
Hello all: Clearly, I'm not getting it! Here is the scenario: On a web page, I have two list boxen and a text box. The first listbox is populated at page load time (if it is not a postback). This listbox has AutoPostback = True. When the user selects an item from this list, the second listbox is populated with more items relevant to this selection. I am using an SQLDataSource web control for this. These items are headers. I want, when...
15
2363
by: Doogie | last post by:
I have a .net app that a user currently enters a number in a text box, hits a button and a data call is executed. She wants the ability to enter in multiple numbers (up to 100). So to make things look better visually for that, I created a listbox under the text box. She enters the number in the text box, clicks another button I added and the number is stored in the list box. Then my plan was to grab all those numbers from the list box...
0
8687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8617
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8884
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7751
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.