Fill Text Caption with Value

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

Guest

I have a form that is reading the default values of the fields in the Main
Form. One of these values is a number refering the the Unique ID of the field
represented as a Combo Box. However, I would like to show the second column
of the table that this Combo Box references in its value. Does this makes
sense?

In other words, let's say I have a table with the following fields:
ID Name
1 John
2 Bob

The combo box in the Main Form refers to the above table, and is bound to
the first column, but displays the Name column. As a default value, the form
has "1". So when a new record is added, it will use "John" as the default
value.

What I would to do is in the new Form I am creating, is to display the
Default Value in this Combo Box of the Main Form but to its corresponding
value in the Second Column. That is, instead of showing "1", I want to show
"Bob".

Is this Possible?

Thanks.
 
I have a form that is reading the default values of the fields in the Main
Form. One of these values is a number refering the the Unique ID of the field
represented as a Combo Box. However, I would like to show the second column
of the table that this Combo Box references in its value. Does this makes
sense?

In other words, let's say I have a table with the following fields:
ID Name
1 John
2 Bob

The combo box in the Main Form refers to the above table, and is bound to
the first column, but displays the Name column. As a default value, the form
has "1". So when a new record is added, it will use "John" as the default
value.

What I would to do is in the new Form I am creating, is to display the
Default Value in this Combo Box of the Main Form but to its corresponding
value in the Second Column. That is, instead of showing "1", I want to show
"Bob".

Is this Possible?

Thanks.

Hi,
Try: Set Properties/Column widths : 0";2"
HTH,
Luan
 
Thank you Luan but I don't understand your response. There is no Column
property for a Label. Or are you thinking I am trying to use a combo box?

Martin
 
if you are wanting to display the 2nd column's data on a new form, you can
add a text box and set it's control source to forms![MyForm].ComboBoxName.
Column(1)

Of course you will need to change the [MyForm] and [ComboBoxName] to the form
and control in your database. Column references start at 0 instead of 1, so
the first field in the combo box is column(0) and the 2nd is column(1).
 
I think I did not communicated what I need. I am trying to display, not
select, the default value of the field from the Main Form. In the example I
described, the combo field in the Main Form is bound to the first column, and
shows the second column. Therefore, if I set the default value in this combo
box, it will have to be any value in the ID column. Let's say that I set '2'
as the default value, which will display Bob when a new record is entered.

Now, what I would like to do, is in a different form, read the value stored
as default in the main form. In the case of the field I described above, I
want to show that the default value stored in the field's properties Default
Value is 'Bob' and not the '2'.

I hope this explains it further. Thanks for your help.

lwperry said:
if you are wanting to display the 2nd column's data on a new form, you can
add a text box and set it's control source to forms![MyForm].ComboBoxName.
Column(1)

Of course you will need to change the [MyForm] and [ComboBoxName] to the form
and control in your database. Column references start at 0 instead of 1, so
the first field in the combo box is column(0) and the 2nd is column(1).
I have a form that is reading the default values of the fields in the Main
Form. One of these values is a number refering the the Unique ID of the field
represented as a Combo Box. However, I would like to show the second column
of the table that this Combo Box references in its value. Does this makes
sense?

In other words, let's say I have a table with the following fields:
ID Name
1 John
2 Bob

The combo box in the Main Form refers to the above table, and is bound to
the first column, but displays the Name column. As a default value, the form
has "1". So when a new record is added, it will use "John" as the default
value.

What I would to do is in the new Form I am creating, is to display the
Default Value in this Combo Box of the Main Form but to its corresponding
value in the Second Column. That is, instead of showing "1", I want to show
"Bob".

Is this Possible?

Thanks.
 
I figured it out. I am using a Label in my form and using the DLookUp
function is provding the results I wanted to obtain.

Thanks everyone for trying to help. For others facing this same challenge, I
hope this post provides any help.

Best.

Martin said:
I think I did not communicated what I need. I am trying to display, not
select, the default value of the field from the Main Form. In the example I
described, the combo field in the Main Form is bound to the first column, and
shows the second column. Therefore, if I set the default value in this combo
box, it will have to be any value in the ID column. Let's say that I set '2'
as the default value, which will display Bob when a new record is entered.

Now, what I would like to do, is in a different form, read the value stored
as default in the main form. In the case of the field I described above, I
want to show that the default value stored in the field's properties Default
Value is 'Bob' and not the '2'.

I hope this explains it further. Thanks for your help.

lwperry said:
if you are wanting to display the 2nd column's data on a new form, you can
add a text box and set it's control source to forms![MyForm].ComboBoxName.
Column(1)

Of course you will need to change the [MyForm] and [ComboBoxName] to the form
and control in your database. Column references start at 0 instead of 1, so
the first field in the combo box is column(0) and the 2nd is column(1).
I have a form that is reading the default values of the fields in the Main
Form. One of these values is a number refering the the Unique ID of the field
represented as a Combo Box. However, I would like to show the second column
of the table that this Combo Box references in its value. Does this makes
sense?

In other words, let's say I have a table with the following fields:
ID Name
1 John
2 Bob

The combo box in the Main Form refers to the above table, and is bound to
the first column, but displays the Name column. As a default value, the form
has "1". So when a new record is added, it will use "John" as the default
value.

What I would to do is in the new Form I am creating, is to display the
Default Value in this Combo Box of the Main Form but to its corresponding
value in the Second Column. That is, instead of showing "1", I want to show
"Bob".

Is this Possible?

Thanks.
 
Back
Top