473,473 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Concatenate problem - how do I reference another field?

AccessIdiot
493 Contributor
As usual, this seems like a really simple problem but it is stumping me. I am using Access 2007.

I have a form with a combo box that is fed by a look up table. The look up table has an auto id and a text field. The text is what you see in the combo box on the form but it's one of those bound to column 1 (auto id), column count is 2, column widths are 0" and 3" kind of things (my experience with Access 2003 is that this was a common thing to do. Is there a better way to do it now?).

Expand|Select|Wrap|Line Numbers
  1. //values in look up table lut_Island which feeds cbo_Island on the form.
  2. //The value chosen in cbo_Island gets stored in [IslandName] in the main table.
  3. 1  Apple Island
  4. 2  Banana Island
  5. 3  Coconut Island
  6. // etc.
  7.  
Anyway, on my form there is also a text box. In this text box I want to concatenate some text with what was chosen in the combo box. So the code on my text box looks like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtField_AfterUpdate()
  2.  txtField = [IslandName] & " Platform " & txtField
  3. End Sub
So when the user types a number into txtField what I WANT it to show after they exit the field is "Banana Island Platform 1". Instead what it is displaying is "2 Platform 1" because 2 is the auto id code for Banana Island.

I hope I have explained this well.

What is the code I have to use to get the text value of the combo box to display and not the code value?
Aug 11 '10 #1

✓ answered by jimatqsi

If [IslandName] is the name of the combo box, try
[IslandName]!Column(1)

This references the 2nd column of the combo box.

Jim

2 1908
jimatqsi
1,271 Recognized Expert Top Contributor
If [IslandName] is the name of the combo box, try
[IslandName]!Column(1)

This references the 2nd column of the combo box.

Jim
Aug 11 '10 #2
AccessIdiot
493 Contributor
[IslandName] is the name of the field in the main table that the value of cboIslandName gets stored in, but I'll give it a try with the combo box name. Thanks!

That worked, I just needed to change it to column 2, not 1. Thanks!

cboIslandName.Column(2)
Aug 11 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Rose | last post by:
I want to use the javascript dom to reference the field of a record in a multi-record html form when that field has been changed. How do I reference the field? I have a JavaScript function coded...
8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
14
by: mchlle | last post by:
How can I filter records of a subform that is part of a tab control? The filter works fine on the form when it is not part of the tab using this in the macro condition: !!="Today" I have a main...
2
by: luanhoxung | last post by:
hi !! i have trouble with reference in VBA pls tell me the way to reference one field in code VBA i used "table!<table>.field.<fieldbut errored. i dont understand clearly the errored message
4
by: bdockery | last post by:
Access 2007 I have a table with three columns. Country, State, City What I want to do is have a form where the Country, and State, lookups auto-populate when the city lookup is chosen. It...
6
by: bcotten | last post by:
I have a simple Contact Management database. There is a table called 'Contacts' containing a email field. I need to concatenate each record's email field into one text string separated by a...
5
by: Dean | last post by:
Hi, I have a table with non-unique identifiers. I need to take all the values with the same ID's and combine them into one field with a semicolon as a seperator. These values may exceed 255...
10
by: Aaron Hoffman | last post by:
Hello, I'm hoping someone might be able to offer some guidance to my problem. I have one query in MS Access which consists of 2 tables joined by a SEQUENCE_ID. By joining the two tables I am...
6
jinalpatel
by: jinalpatel | last post by:
I am getting this error when I try to enforce referencial integrity from Harvest II table to tractsum table I have attached the relationship diagram. Please give me the hint about possibilities of...
2
by: RonMcIntire | last post by:
I wish to concatenate a column of email addresses in an access table or query into one string so I can cut and paste the string into the TO: field in an email. I'm using Access 2003. Can it be...
0
marktang
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,...
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...
1
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...
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,...
1
isladogs
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...
0
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...
0
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...

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.