473,756 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to properly set a value on a multi-column combobox

2 New Member
Hi,

I'm having issues setting a multi-column combobox in the right way.

What I'm trying to do is that when I click on a table (access 2007 subform), a form should fill with the values of the record I clicked on.

No problem until I have to fill correctly a multi-column combo for 2 reasons:

- In the table I only have the value of one of the 2 columns (That can be solved if I query again one of my external tables, but if you have another way of doing it, I would appreciate it.... maybe something like mooving the selected option of a combo until it matches my value but no idea if that's possible)

- When I try to set the value of the second column of my combo like this:
Expand|Select|Wrap|Line Numbers
  1.   [Form_Tool Administration - Manage Users].CBoxProfile.Column(1) = Profile
It gives me the following error message:
Runtime Error 424: Object Required
The funny thing is that it actually sets my second column to the value I want, but I keep having that error. The form, combobox control and column exist... and I actually have the right value in my variable "Profile".

Could you help me with this issue, please?
Dec 1 '09 #1
1 3158
vgarzon
2 New Member
Hi, After trying to do this for a while, I came up with the solution.

I have a form to insert/modify users, and a sub-form to display the existing users. On a combobox, I have 2 columns, column 0 with some IDs and column 1 with their corresponding descriptions. On my sub-form I have several columns, including the description. The idea was to click on a user, and get all his data filled on the form.

So I put this on the sub-form OnClick events:
Expand|Select|Wrap|Line Numbers
  1. 'Get the description
  2.     For copt = 0 To ([UserAdmin].CBoxProfile.ListCount - 1)
  3.         If ([UserAdmin].CBoxProfile.Column(1, copt) = Description) Then
  4.                 'Set the combobox to the corresponding value
  5.                 [UserAdmin].CBoxProfile = [UserAdmin].CBoxProfile.ItemData(copt)
  6.             Exit For
  7.         End If
  8.     Next copt
  9.  
Dec 2 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3634
by: Dave Patton | last post by:
Can someone point me to a definitive source for the answers to the following two questions: 1) In an environment with Redhat Linux 2.4.21-27.0.1, Apache 1.3.31, PHP 4.3.10, and GNU gettext 0.14.1, will using PHP's gettext support along with the GNU gettext utilities work properly? For example, I've seen references to the translated strings in .mo files not always being what appears
3
2829
by: Andrew | last post by:
I'm having a major problem with a databound listbox in C#. In the constructor for the form I am trying to pre-select some of the items based in information in the database. When I step through the debugger it all seems to be working properly until the Load function is called, and then all my selections but 1 are unselected. Anybody had any experience with this and know of a fix? Listbox is databound Listbox appears on a tabpage inside...
5
2936
by: Andrew Poulos | last post by:
If I'm searching for an occurance of a value in a multi-dimensional array how can I get it's index returned as an array, if found? For example, if: foo = new Array(); foo = , 5, , 9, 10]; Array.prototype.findValue = function(val) { // blah }
7
2139
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the following: (TextBox)UserPrefix=(TextBox)e.Item.Cells.Controls; string strUserPrefix=UserPrefix.Text; I keep getting the following error and I don't know why because I have declared the UserPrefix as a textbox using "protected...
10
8571
by: ken | last post by:
Hi, Say I have a list box. I also created a control on a form bound to that list box. When I click different rows in the listbox the control changes the ID of the row depending on what I click. One thing I'm doing is setting the .selected(i) property of the list box to true. On the screen I see that a different row gets hillighted, but the bound control on the form is showing the wrong value? So changing what is selected with code did...
0
1067
by: Innes MacKenzie | last post by:
I have an application (a .NET 2.0 windows service) which launches numerous short-lived processes (also a .NET 2.0 application). Occasionally, one or two of these processes will not run properly but instead stay running, 'just sitting there', exhibiting a number of unusual properties: Memory usage about 68K - normal .NET processes take up multi-Megabytes of memory. Process has a single thread in the Wait:Suspended state. The thread's...
7
2225
by: robin1983 | last post by:
Hi, good morning everyone, i have a file called attendence.php The problem is that some part of code is executing properly and half of the code is not and i dont get any warning or error message. For more information i m giving the whole code below. please give me the solution, the code is executing upto line no 95 (echo $halfday;) and after this line not a single code is executing. i am not able to get solution. So plaease help me in solving...
3
5495
by: jim | last post by:
Each night, a scheduled task copies certain information from an MS Access db to a MySQL db that serves as a data warehouse. I would like to begin replicating multi-value fields from Access to MySQL, but when I try I run into the "unable to insert multi-value fields..." error. Does anyone know of a way around this? I would be satisfied with being able to treat all values in the multi-value list as a single text string with some sort of...
0
2264
by: napstar | last post by:
I have a multi value Country parameter in SSRS which is populated by an Oracle dataset.There is also a province parameter which is populated based on the Country selected by the user. These parameters are passed in turn to another dataset which the report is based on. The problem is when the report is run,the first province and country are always in the report whether they were selected or not. If I run the query in SQLPLUS with the parameter...
1
4025
by: Toireasa | last post by:
Hi helpful people, I have a question, which I can't find the answer to anywhere and that worries me that it might not be possible. If anyone can help me, I hope you guys can! I set up a database using MS Access 2007 and, due to the complex nature of the data to be contained within, decided to set up the 'many-to-many' relationships using the multi-value lookups allowed within this version of MSAccess rather than with junction tables. ...
0
9872
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8713
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
7248
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
6534
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
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
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.