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

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

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 3107
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
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...
3
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...
5
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]; ...
7
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...
10
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. ...
0
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...
7
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...
3
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...
0
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.