Hello,
I'm working on a form in Access 2007, and specifically on a combo-box field that displays two columns in the drop-down menu. The problem is that once I make a selection, the field only displays one of the two columns in the filled out box (the column on the left). I'd like to have both columns displayed after making a selection. Does anyone how I can achieve that? Thanks in advance.
John
5 5136 patjones 931
Recognized Expert Contributor
Hi,
Combo boxes display a single value after selection. But, I was able to do what you are suggesting by putting this in for the After Update event of the combo box: - Me.cbo.Value = Me.cbo.Column(0) & " " & Me.cbo.Column(1)
The obvious drawback here is that the combo box's actual value will now be whatever the combined columns are, and this is not a good way to design it. If you feel like you must display more than whatever the bound column is, I would drop a text box in next to the combo box and do it there, so as to keep the combo box single-valued.
Pat
@zepphead80
Hey Pat,
Thanks for your response. I did what you suggested (I think), but I received the following message when I then tried to make a selection from the combo-box:
Microsoft Access can't find the object 'Me.'
If 'Me' is a new macro or macro group, make sure you have saved it and that you have typed its name correctly.
I must admit that I know relatively little about Access, so I have no idea what this message is asking me to do. Any idea how to make it read that code correctly? Thanks again.
John
patjones 931
Recognized Expert Contributor
Hi,
Can you post all the code you have so far?
"Me" is just a shorthand way of saying whatever your current database object is (form, report, etc.) When you type "Me.", a list should pop up with various commands you can use in relation to the form, and also all the controls on the form. Also bear in mind that when I wrote "Me.cbo.Val ue", I was implying that you should replace "cbo" with whatever the name of your combo box is.
Pat
Hey Pat,
Here's the code that I have right now:
Private sub Facility_AfterU pdate()
AfterUpdate.Fac ility.Value = AfterUpdate.Fac ilityID.Column( 0) & " " & AfterUpdate.Fac ilityName.Colum n(1)
End Sub
So the field name for the whole combobox is "Facility," the column on the left is "FacilityID ," and the column on the right is "FacilityNa me."
Also, the two dropdown boxes at the top of the Visual Basic code window are set to "Facility" and "AfterUpdat e," if that helps. Thanks again.
John
These lines - AfterUpdate.Facility.Value = AfterUpdate.FacilityID.Column(0) & " " & AfterUpdate.FacilityName.Column(1)
-
need to be - Me.Facility.Value = Me.FacilityID.Column(0) & " " & Me.FacilityName.Column(1)
Linq ;0)> Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Rich |
last post by:
I'm sure it sounds kinda nutty to display 200 columns and
500,000 rows of data. But I have been pulling data from a
Lotus Notes database into Sql Server for a while now, but
Lotus Notes is starting to crack, columns getting
corrupted. Can't handle the volume of data and number of
columns. Sql Server has no problem. But displaying the
data is the big deal. The end users want to be able to
scroll acros a page to the colum of their...
|
by: dmiller23462 |
last post by:
Somebody take a look and give me any suggestions? My brain is nuked...
Here's my deal....I have online submission forms on my intranet at
work here....I am appending to an Access DB with the input from all
HTML fields and then querying aforementioned DB with different
variables (search by name, wave, reason, etc). The output that I'm
getting (SELECT * 'cause I need all of the data included in the
search) I would like to display in a nice...
|
by: Brian |
last post by:
Hope you all had a great holiday.
I have a subform with a table with a combo box based on a select query. The
combo box is set to display in a form in datasheet view.
When I click the down arrow I can see all of the columns in the combo box
but it only shows one column after selecting it.
I would like all of the columns to display when an item in the list is
selected. Is this possible?
|
by: Rich |
last post by:
I have a form with a combo box on it. The combo box's source is a
access lookup table with two columns, EmployeeName & EmployeeNumber.
I want to display the EmployeeName from the dropdown but store the
EmployeeNumber. I was able to get this work (for the most part) by
setting the Bound Column to 2 and setting the column widths property
to 0.5";1"
The problem is after I click the drop down to select the record that I
want the...
|
by: Ross Hamilton |
last post by:
Can anyone help me with this small problem.
I have a report that is divided into 3 Columns using the page setup, It
displays the report fields in 3 separate columns (Desc & Pg Num) but it only
displays the Page Header on the first column.
Any thoughts??
regards,
| |
by: Wadim Grasza |
last post by:
I want to store and display (on a form or a report) multiple pictures
per
record in an access database. The pictures are not stored within the
database. They are stored as files and the database contains the paths
to the
pictures.
The database consists of two tables:
TABLE DATA
ID Name LastName
|
by: Alpha |
last post by:
Hi,
I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a
listbox that I have binded to a dataset table, "source" which has 3 columns.
I would like to display 2 of those columns, "scode" and "sname", as 1 column
(if not possible then 2 columns will be fine) in the listbox. Can the
listbox display 2 columns information from the dataset and how can I do that?
Also, I set the property of the listbox to selectionmode...
|
by: Joe Van Meer |
last post by:
Hi,
Is the datalist meant for one table or can I use it to display information
from 2 different tables? Or should I be looking at a datagrid instead?
I began my code and kinda ran into a snag where my last two columns I am
displaying are ID fields, one for clientid and the other for empid.
What I would really like is to display their actual names instead of the
ids.
|
by: scratchadere |
last post by:
I am tryin to partition a listbox into multiple columns.Here is the real problem.I am getting data from MS ACCESS database.I want to display it juz like how an email account displays unread messages in multiple columns like Sender,Message Title and some description below it,Message size and probaly date sent.My problem is to display a person's first and last names,Gender,Age,Job role/Position and Salary Scale in a listbox in columns How do i do...
|
by: rn5a |
last post by:
A MS-Access DB has 3 tables - Teacher, Class & TeacherClass. The
Teacher table has 2 columns - TeacherID & TeacherName (TeacherID being
the primary key). The Class table too has 2 columns - ClassID &
ClassName (ClassID being the primary key)
The TeacherClass table has 3 columns - TCID (AutoNumber), TeacherID &
ClassID. One teacher can teach multiple classes & one class can be
taught by multiple teachers. The TeacherClass table basically...
|
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: 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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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: 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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |