By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,302 Members | 3,621 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,302 IT Pros & Developers. It's quick & easy.

Combo change to Text Field on a Form

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.