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

Set variable from value in a table

Hello,

I created a program in which I use modules and classmodules for setting my
variables. For example when I need to set the customerID in a variable I use
something like: Object.Variables.Customers.CusomerID = ....
This works great and is similar in structure as for example the Docmd. or
me. structure.

Now I created a search form which can be opened from many forms, it consist
of only a listbox. The listbox is filled at startup. All necesery data I
keep in a table (row source, column withs etc). When I doubleclick on the
listitem I want a variable to be set. Instead of creating a long If..then.
structure, I want to keep the variables which needs to be set in my table.
So now I have a value in a table, which represents my variable. Is there a
way I can set the variable this way.

For example: I have a record in the table for a cusomter search. When I
doubleclick in the listbox I want the value in my table (which represents
the variable) to be set. So in the table is
"Object.Variables.Customers.CusomerID" (as a value) and the listbox gives a
customerID which needs to be matched to the
Object.Variables.Customers.CusomerID variable.

IS this possible???

Thanx,

Remco
Nov 12 '05 #1
2 3459
If I understand you correctly, I think many of us merely human Access
programmers would do this:

Assuming the data for your listbox is in a table named tblCustomer, and that
it has (at least) two fields:
CustomerID
CustomerName

Set the RowSource of your listbox like this:
SELECT CustomerID,CustomerName FROM tblCustomer

Set the listbox's BoundColumn property to 1, its ColumnCount property to 2,
and its ColumnWidths to 0;1.
Now the listbox should display all of your CustomerNames in a list 1" wide.
(If you want it a different width, change the second value in ColumnWidths.)
When you click on an item in the listbox, the listbox's Value property will
hold the value of the corresponding CustomerID, and be used in coding as
MyListbox.Value. (Use the name of your listbox instead of MyListbox, of
course.)

HTH
- Turtle

"Remco Groot Beumer" <in**@rgbplus.nl> wrote in message
news:c0**********@news3.tilbu1.nb.home.nl...
Hello,

I created a program in which I use modules and classmodules for setting my
variables. For example when I need to set the customerID in a variable I use something like: Object.Variables.Customers.CusomerID = ....
This works great and is similar in structure as for example the Docmd. or
me. structure.

Now I created a search form which can be opened from many forms, it consist of only a listbox. The listbox is filled at startup. All necesery data I
keep in a table (row source, column withs etc). When I doubleclick on the
listitem I want a variable to be set. Instead of creating a long If..then.
structure, I want to keep the variables which needs to be set in my table.
So now I have a value in a table, which represents my variable. Is there a
way I can set the variable this way.

For example: I have a record in the table for a cusomter search. When I
doubleclick in the listbox I want the value in my table (which represents
the variable) to be set. So in the table is
"Object.Variables.Customers.CusomerID" (as a value) and the listbox gives a customerID which needs to be matched to the
Object.Variables.Customers.CusomerID variable.

IS this possible???

Thanx,

Remco

Nov 12 '05 #2
Remco Groot Beumer wrote:
Instead of creating a long If..then.
structure, I want to keep the variables which needs to be set in my table.
So now I have a value in a table, which represents my variable. Is there a
way I can set the variable this way.


Maybe I don't understand the question correctly; but does the article
'public variables' on my site provide any help?

Especially the Click portion of the question is unclear to me. It may
help if you mail me in Dutch?
--
Bas Cost Budde
http://www.heuveltop.nl/BasCB

Nov 12 '05 #3

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

Similar topics

6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
3
by: Geoff Winsor | last post by:
Hi, I am experiencing a problem with recalling a session variable which stores whether a person is logged in to a "members only" section of a website. This area of the site has been working...
1
by: RayP | last post by:
I'd appreciate some help I'm having trying to run a cursor. First, some background. The Status field of all records on Table A needs changing from 1 to 0 where there is no corresponding record...
1
by: farooqazeem | last post by:
Hi guys, I’m facing some problem can u solve it. Problem is: I’m giving user Id and password in (Login_sess.asp) and submit it to page (sess_test.asp). I am setting session variable...
1
by: John_H | last post by:
Re: ASP.NET 2.0 I would like suggestions or code examples on how to collect a variable length list of input data (item# & item quantity specifically). I thought that I could accomplish this...
1
by: stephane | last post by:
I have a problem which must be in this : print" <script type='text/javascript'> document.location.replace('http://127.0.0.1/add_task.php?req_id={$maxValue}&tk_request_name={$req_name}');...
5
by: strawberry | last post by:
In the function below, I'd like to extend the scope of the $table variable such that, once assigned it would become available to other parts of the function. I thought 'global $table;' would solve...
2
by: Kevin | last post by:
I am having difficulty updating a variable page-time-stamp in the following snippit. The variable time-stamp is initialized from the attribute time-stamp from the log element. Some of the page...
3
by: adiel_g | last post by:
Hello everyone, I am trying to move a field name to a variable in vb.net. For example, first I retrieve the record from the database and save its value: .... userGroup =...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...

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.