How to create a look up in a text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table called Vessels. In that Table the ID is used to track vessels
through out my database. Normally I would link the drop down box and use the
ID on forms to show the vessel name. This I understand how to do. But I
want a text box to display the same information. Is this possible?

Data Source - VID
Look Up Box Row Sorce- SELECT TblVessel.VID, TblVessel.VNAME FROM TblVessel;
Thanks in advance Jen
 
I not sure that what you are looking for, but you can display the name of the
Vessel, after one is selected in the combo Box, by writing in the new text
box control source

=[ComboName].column(1)

that will display the name, the column count start with 0
 
Let me try to be a little bit more clr..

I have a table for my vessels. Each vessel gets an id number and name.

Now I have a second table for the vessel activities and they are linked by
the Vessel ID number.

On a form to enter the Vessel Activities I want to put Vessel 1 in a field
and then have a text field auto generate the Vessel's name. I normally do
this with the drop down but I want to use a text box instead..

Ofer said:
I not sure that what you are looking for, but you can display the name of the
Vessel, after one is selected in the combo Box, by writing in the new text
box control source

=[ComboName].column(1)

that will display the name, the column count start with 0

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Ms Jen said:
I have a table called Vessels. In that Table the ID is used to track vessels
through out my database. Normally I would link the drop down box and use the
ID on forms to show the vessel name. This I understand how to do. But I
want a text box to display the same information. Is this possible?

Data Source - VID
Look Up Box Row Sorce- SELECT TblVessel.VID, TblVessel.VNAME FROM TblVessel;
Thanks in advance Jen
 
You can use DLookup in the control source of the Text field
=DLookUp("[vessels name field name]","[vessels table name]","[vessels Id
field name] =" & [vessels id field name in the form])

If the vessels id field type is string, try this
=DLookUp("[vessels name field name]","[vessels table name]","[vessels Id
field name] ='" & [vessels id field name in the form] & "'")

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Ms Jen said:
Let me try to be a little bit more clr..

I have a table for my vessels. Each vessel gets an id number and name.

Now I have a second table for the vessel activities and they are linked by
the Vessel ID number.

On a form to enter the Vessel Activities I want to put Vessel 1 in a field
and then have a text field auto generate the Vessel's name. I normally do
this with the drop down but I want to use a text box instead..

Ofer said:
I not sure that what you are looking for, but you can display the name of the
Vessel, after one is selected in the combo Box, by writing in the new text
box control source

=[ComboName].column(1)

that will display the name, the column count start with 0

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Ms Jen said:
I have a table called Vessels. In that Table the ID is used to track vessels
through out my database. Normally I would link the drop down box and use the
ID on forms to show the vessel name. This I understand how to do. But I
want a text box to display the same information. Is this possible?

Data Source - VID
Look Up Box Row Sorce- SELECT TblVessel.VID, TblVessel.VNAME FROM TblVessel;
Thanks in advance JenYou
 
WORKS PERFECT.....THANK YOU

Ofer said:
You can use DLookup in the control source of the Text field
=DLookUp("[vessels name field name]","[vessels table name]","[vessels Id
field name] =" & [vessels id field name in the form])

If the vessels id field type is string, try this
=DLookUp("[vessels name field name]","[vessels table name]","[vessels Id
field name] ='" & [vessels id field name in the form] & "'")

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Ms Jen said:
Let me try to be a little bit more clr..

I have a table for my vessels. Each vessel gets an id number and name.

Now I have a second table for the vessel activities and they are linked by
the Vessel ID number.

On a form to enter the Vessel Activities I want to put Vessel 1 in a field
and then have a text field auto generate the Vessel's name. I normally do
this with the drop down but I want to use a text box instead..

Ofer said:
I not sure that what you are looking for, but you can display the name of the
Vessel, after one is selected in the combo Box, by writing in the new text
box control source

=[ComboName].column(1)

that will display the name, the column count start with 0

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I have a table called Vessels. In that Table the ID is used to track vessels
through out my database. Normally I would link the drop down box and use the
ID on forms to show the vessel name. This I understand how to do. But I
want a text box to display the same information. Is this possible?

Data Source - VID
Look Up Box Row Sorce- SELECT TblVessel.VID, TblVessel.VNAME FROM TblVessel;
Thanks in advance JenYou
 
Sorry just one more question...

Now I am using the first DLookUp you gave me. Now can I add one more field
to the equation? It is a Free Text Field and I want it to follow the Vessel
Name...( It usally list the Barges)


Ofer said:
You can use DLookup in the control source of the Text field
=DLookUp("[vessels name field name]","[vessels table name]","[vessels Id
field name] =" & [vessels id field name in the form])

If the vessels id field type is string, try this
=DLookUp("[vessels name field name]","[vessels table name]","[vessels Id
field name] ='" & [vessels id field name in the form] & "'")

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Ms Jen said:
Let me try to be a little bit more clr..

I have a table for my vessels. Each vessel gets an id number and name.

Now I have a second table for the vessel activities and they are linked by
the Vessel ID number.

On a form to enter the Vessel Activities I want to put Vessel 1 in a field
and then have a text field auto generate the Vessel's name. I normally do
this with the drop down but I want to use a text box instead..

Ofer said:
I not sure that what you are looking for, but you can display the name of the
Vessel, after one is selected in the combo Box, by writing in the new text
box control source

=[ComboName].column(1)

that will display the name, the column count start with 0

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I have a table called Vessels. In that Table the ID is used to track vessels
through out my database. Normally I would link the drop down box and use the
ID on forms to show the vessel name. This I understand how to do. But I
want a text box to display the same information. Is this possible?

Data Source - VID
Look Up Box Row Sorce- SELECT TblVessel.VID, TblVessel.VNAME FROM TblVessel;
Thanks in advance JenYou
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top