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

Lookup List with Code Hiding?

Hi,

Is there a way to use a 2 column table as a lookup for a combo box,
having one field show up on the form, and the other field actually
written to the output table?

Here's an example:

I have a reference table called "R" with the following values: { (0,
'Price'),
(1, 'Comp'), (2, 'Alt') }

I also have a table called "T" that uses field 1 from "R" (eg: {0, 1,
2}).

I'm also using a form as an interface to "T". Now since this is
intended for end user use, I want to avoid using codes. So when the
user gets to the combo box that uses "R" as a source, the user will
see { 'Price', 'Comp', 'Alt' }. And when an item is selected, one of
the previous list will be shown in the control. However, I would like
"T" to get the corresponding code.

So if the user picks 'Price', s/he will see 'Price' on the form at all
times, but T will receive 0. And so forth.

Is there a way to do this without any programming?
Thanks.
Nov 13 '05 #1
3 1372
That's a pretty standard thing. Set the Row Source Type property to
Table/Query, and set the Row Source to a query that returns both columns.
Set the Column Count to 2, and set the Column Widths to 0;1 (or whatever
width you need to display the text). Set the Bound Column to 1. Set the
Control Source to the appropriate field in table T.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

<xm****@yahoo.com> wrote in message
news:4a**************************@posting.google.c om...
Hi,

Is there a way to use a 2 column table as a lookup for a combo box,
having one field show up on the form, and the other field actually
written to the output table?

Here's an example:

I have a reference table called "R" with the following values: { (0,
'Price'),
(1, 'Comp'), (2, 'Alt') }

I also have a table called "T" that uses field 1 from "R" (eg: {0, 1,
2}).

I'm also using a form as an interface to "T". Now since this is
intended for end user use, I want to avoid using codes. So when the
user gets to the combo box that uses "R" as a source, the user will
see { 'Price', 'Comp', 'Alt' }. And when an item is selected, one of
the previous list will be shown in the control. However, I would like
"T" to get the corresponding code.
t
So if the user picks 'Price', s/he will see 'Price' on the form at all
times, but T will receive 0. And so forth.

Is there a way to do this without any programming?
Thanks.

Nov 13 '05 #2
xm****@yahoo.com wrote in message news:<4a**************************@posting.google. com>...
Hi,

Is there a way to use a 2 column table as a lookup for a combo box,
having one field show up on the form, and the other field actually
written to the output table?

Here's an example:

I have a reference table called "R" with the following values: { (0,
'Price'),
(1, 'Comp'), (2, 'Alt') }

I also have a table called "T" that uses field 1 from "R" (eg: {0, 1,
2}).

I'm also using a form as an interface to "T". Now since this is
intended for end user use, I want to avoid using codes. So when the
user gets to the combo box that uses "R" as a source, the user will
see { 'Price', 'Comp', 'Alt' }. And when an item is selected, one of
the previous list will be shown in the control. However, I would like
"T" to get the corresponding code.

So if the user picks 'Price', s/he will see 'Price' on the form at all
times, but T will receive 0. And so forth.

Is there a way to do this without any programming?
Thanks.


Yeah, simple. Create a combobox. Set the Column Count property to 2.
Set the Column Widths property to "0;1" (first one MUST be zero).
Then the user will see and can choose from the data in the second
column, but the data in the first column is what gets stored in the
database. The rowsource would be something like:

SELECT IDNo, ItemText
FROM TableX
WHERE...
ORDER BY ItemText

The wizard pretty much does all this stuff for you...
Nov 13 '05 #3
Hi,
Thanks to everyone who responded to the post. I used 0;1 for the
column widths and everything works beautifully. Only the descriptions
show up on the controls, but behind the scenes the code gets written
to the table.
Take Care!
Nov 13 '05 #4

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

Similar topics

11
by: John Collyer | last post by:
Hi, In assembly language you can use a lookup table to call functions. 1. Lookup function address in table 2. Call the function Like: CALL FUNCTION
7
by: Marco Simone | last post by:
Hi, What is your opinion about using Lookup field in table. I would like to use lookup field in table 1, so that I can choose data in combo box from table 2. Is this good design of database? ...
3
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two...
3
by: Chris | last post by:
I have a lookup table which contains authorisation codes for a particular operation. When a user makes a booking a random reference number is generated. The user obtains the code from his/her...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
1
by: James | last post by:
I am used to VB6 but need to develop something in .Net. I need to create several bound combo-boxes which will use lookup tables to get their values. I created a form using the dataform wizard....
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
3
by: Radu | last post by:
Hi. I have the following problem - I need to build a user-control in asp.net (an ascx) to somehow allow the users to search by first name or last name among a big (~10.000 records) email addresses...
1
by: freetime | last post by:
Greetings, This is my first post so I will try to be brief and accurate. I have a report that uses 9 user selectable filters (Dates, Y/N's as Combo Boxes and 4 Multi-Select List Boxes. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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,...
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
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,...

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.