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

Combo change to Text Field on a Form

Hello;
I have a table that is equipment. This table has a filed called Owner
and that Owner filed is Looked up from a table called employee. and
the query request the serial number of the employee and his/her name.
I have this field bound to the serial number but it displays the name
in a data sheet. Works great,

My problem is I have a form that I want to be used as display and
informational but not data entry or editing. I would like to display
the employees name on it but when I change the combo box to a text
field it shows the employee number.
Nov 12 '05 #1
4 2387
Am Thu, 15 Apr 2004 13:06:04 -0400 schrieb N.Graves:
Hello;
I have a table that is equipment. This table has a filed called Owner
and that Owner filed is Looked up from a table called employee. and
the query request the serial number of the employee and his/her name.
I have this field bound to the serial number but it displays the name
in a data sheet. Works great,

My problem is I have a form that I want to be used as display and
informational but not data entry or editing. I would like to display
the employees name on it but when I change the combo box to a text
field it shows the employee number.


Hello,

try

=Dlookup("persontable","namefield","id=" & combobox

as recordsource property of the field
HTH
Karpi
<fluctuat nec mergitur>
Nov 12 '05 #2
Thank you for suggestion!

I tried to use your suggestion and I don't think my first post was
clear enough.

Bare with me and I'll try again.

I have a form I want to be a view only form. This equipment table has
several fields that the values are lookups from other tables. An
example is the Owner field is a lookup field based on the Employee
table it is bound to the employee number but displays the name. When
I created the form for Equipment table the field "Owner" is displayed
as a Combo box and I want to convert it to a text field. When I do
this it will only display the Employee ID and not the name.

Please let me know if you have any other suggestions.
On Thu, 15 Apr 2004 22:22:22 +0200, Hans-Joerg Karpenstein
<hj***********@web.de> wrote:
Am Thu, 15 Apr 2004 13:06:04 -0400 schrieb N.Graves:
Hello;
I have a table that is equipment. This table has a filed called Owner
and that Owner filed is Looked up from a table called employee. and
the query request the serial number of the employee and his/her name.
I have this field bound to the serial number but it displays the name
in a data sheet. Works great,

My problem is I have a form that I want to be used as display and
informational but not data entry or editing. I would like to display
the employees name on it but when I change the combo box to a text
field it shows the employee number.


Hello,

try

=Dlookup("persontable","namefield","id=" & combobox

as recordsource property of the field
HTH
Karpi
<fluctuat nec mergitur>


Nov 12 '05 #3
Hi!

I think Karpi's idea WAS good for you. What you need to do is this:

Create a Text Box. As it's Control Source use the DLookup Function.
This is how you use it:

=DLookup("<Name of field you want displayed (EmployeeName)>", "<Name
of the table where it's kept (Employees)>", "<Name of the key field
(EmployeeNumber)> = " & <The field that contains the Employee number
for which you want to display the name (Owner)>)

Without the explainations it would look like this:

=Dlookup("EmployeeName", "Employees", "EmlpoyeeNumber = " & [Owner])

Now you only need to change the names to the exact names you used (if
they're different).

If you don't want the user to be able to change the data just change
the field properties "Enabled" to "No" and "Locked" to "Yes" (they're
on the "Data" tab of the Properties, when the textbox is selected)

Hope this helps...

Noam Nelke, Israel.
Nov 12 '05 #4
Thank you very much for your insight.

I think the part that of Karpi response was the statement "as record
source property of the field".

That worked very well and the second part of your suggestion was the
one that I used for my forms

Thanks

On 16 Apr 2004 17:24:18 -0700, no*******@hotmail.com (Noam Nelke)
wrote:
Hi!

I think Karpi's idea WAS good for you. What you need to do is this:

Create a Text Box. As it's Control Source use the DLookup Function.
This is how you use it:

=DLookup("<Name of field you want displayed (EmployeeName)>", "<Name
of the table where it's kept (Employees)>", "<Name of the key field
(EmployeeNumber)> = " & <The field that contains the Employee number
for which you want to display the name (Owner)>)

Without the explainations it would look like this:

=Dlookup("EmployeeName", "Employees", "EmlpoyeeNumber = " & [Owner])

Now you only need to change the names to the exact names you used (if
they're different).

If you don't want the user to be able to change the data just change
the field properties "Enabled" to "No" and "Locked" to "Yes" (they're
on the "Data" tab of the Properties, when the textbox is selected)

Hope this helps...

Noam Nelke, Israel.


Nov 12 '05 #5

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

Similar topics

1
by: FZ | last post by:
Hi Gang, I was wondering if a generous person might be able to walk me through what I believe is a pretty simple task. I actually have significant Access experience, but I haven't done it in...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
1
by: The Eclectic Electric | last post by:
I'd be very grateful if anyone could help me with this. From my limited knowledge of Javascript I don't think it is possible, but I'll punt anyway. I downloaded and very slightly adapted this...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
2
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
6
by: dougmeece | last post by:
Hello, I have a form that I would like to auto-populate text boxes in based on the selection made from a combo box. I have set the form record source to a table "SubmittedTo" which contains 3...
2
by: fredloh | last post by:
i have a table with a yes/no field call "Edited". i have a button that runs code to set the "Edited" field of a selected record to "yes". the code also set the rowsource (using SQL Update and Set...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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,...
0
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...

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.