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. 3 1405
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.c om> wrote in message
news:4a******** *************** ***@posting.goo gle.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. 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. xm****@yahoo.co m wrote in message news:<4a******* *************** ****@posting.go ogle.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...
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! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
|
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?
Thanks in advance, Marco
|
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 reading about it on google,
but there is something I still don't understand, and I'm hoping someone will
be willing to explain it to me in small words.
Let's say I have a table for addresses, and it includes a field for state.
What I would...
|
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 supervisor and inputs it to
allow the operation to continue. In VBA the authorisation is checked
(DLookUp) for validity.
I have activated full security but find that obviously DLookup will
only work if there is read permission for the table. But...
|
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 that are hard
to find. The main problem I am having right now is that I have a report
that is sorted by one of these lookup fields and it only displays the
record's ID number. When I add the source table to the query it makes
several records...
| |
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. As part of the setup, I
specified a new dataset, which included the data & lookup tables. I also
specified the relationships when required.
I then added a combo box control to my form, following the instructions from
|
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 attempting to bind a user control I've written, "ImageBox", to a
repeater.
The user control takes a custom property, "ContentID", that will execute a
database lookup and load an image.
|
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 database
(SQL server table). I am thinking of allowing them to type something
in EITHER the last name, EITHER the first name textbox, and on each
text change to show in a combobox the records starting with that
letter combination.
Say for...
|
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. 2 of the Multi-Select Boxes acquire their data from other tables as Lookup's. All functions for the filters operate properly pulling the data needed. One of my options with the data is to send it to a Report that can be printed.
The request...
|
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...
|
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,...
| |
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...
|
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,...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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: 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...
| |