ComboBox Values to TextBox

J

John

Hi,
On my form "frmDetails", I have a ComboBox "cboProblem" and a field [RATE]

The ComboBox looks up the values from the table tblProblem with 3 fields
[ID] [TASK] [RATE]
The 3 fields are formatted as AutoNumber, Text and Currency
The ComboBox RowSource is SELECT [tblProblem].[ID], [tblProblem].[Task],
[tblProblem].[Rate] FROM tblProblem;

I need to select a Problem from the ComboBox and the [Rate] field
automatically populate.
I am using Access 2007.
I have tried a few variants of the following but cannot get get the field to
populate.
"Me!Rate = Me!Problem.Column(3
I know this is a common ground question but I cannot get the Value to
populate the text boxe.

Any Help Please

Regards
John
 
G

Guest

Hi John,

If you are simply wanting to display the Rate that is in the third column,
you need to use the following as the Rate text box control source.

=me.cboProblem.column(2)

Note that it's a 2 - columns in a combo box start numbering at 0.

Hope this helps.

Damian.
 
G

Guest

In addition to Damian,
If you want to store the RATE in a field in the table then sometimes you get
an error that the field can't be found using

Me!Rate

Use instead
Me.Rate

I'm not familiar with Access 2007, so I don't know if it was solved there
 
J

John

Thanks for the replies guys.
Unfortuntely I can only get Kens method to work (Partially).
1 Bound field works great but I have now foun a need to have 2 fields
populated and any data in the unbound field is not stored in the Records
Source Table. Is it possible to have multiple bound fields based on the
combobox values.
I have tried using the =Me.[Task].Value = [cboProblem].[column](2) in the
After Update event of the ComboBox
but this produces nothing in the TextBox [Task]

Any further Ideas?

Kind Regards

John


Ken Snell (MVP) said:
See this article at The ACCESS Web site:
http://www.mvps.org/access/forms/frm0058.htm

--

Ken Snell
<MS ACCESS MVP>


John said:
Hi,
On my form "frmDetails", I have a ComboBox "cboProblem" and a field
[RATE]

The ComboBox looks up the values from the table tblProblem with 3 fields
[ID] [TASK] [RATE]
The 3 fields are formatted as AutoNumber, Text and Currency
The ComboBox RowSource is SELECT [tblProblem].[ID], [tblProblem].[Task],
[tblProblem].[Rate] FROM tblProblem;

I need to select a Problem from the ComboBox and the [Rate] field
automatically populate.
I am using Access 2007.
I have tried a few variants of the following but cannot get get the field
to populate.
"Me!Rate = Me!Problem.Column(3
I know this is a common ground question but I cannot get the Value to
populate the text boxe.

Any Help Please

Regards
John
 
G

Guest

1. If the fields are UnBound the value won't be stored in the table, if you
want them to be stored in the table, bound the text box to the fields in the
table

2. Check the combo ColumnCount property, do you have 3 in it?
If not, then the column 3 wont be recognised

3. Did you put this line In the code section?
(Code section mean, when the cursor located in the After update event of the
combo, there is a button with three dots, press it and select code view)

=Me.[Task].Value = [cboProblem].[column](2)

If so, why do you have two equal signs?
try:
Me.[Task].Value = Me.[cboProblem].column(2)

---------------------------------------------------------------
Note: section 3 can be done after you check section 2
---------------------------------------------------------------

--
Good Luck
BS"D


John said:
Thanks for the replies guys.
Unfortuntely I can only get Kens method to work (Partially).
1 Bound field works great but I have now foun a need to have 2 fields
populated and any data in the unbound field is not stored in the Records
Source Table. Is it possible to have multiple bound fields based on the
combobox values.
I have tried using the =Me.[Task].Value = [cboProblem].[column](2) in the
After Update event of the ComboBox
but this produces nothing in the TextBox [Task]

Any further Ideas?

Kind Regards

John


Ken Snell (MVP) said:
See this article at The ACCESS Web site:
http://www.mvps.org/access/forms/frm0058.htm

--

Ken Snell
<MS ACCESS MVP>


John said:
Hi,
On my form "frmDetails", I have a ComboBox "cboProblem" and a field
[RATE]

The ComboBox looks up the values from the table tblProblem with 3 fields
[ID] [TASK] [RATE]
The 3 fields are formatted as AutoNumber, Text and Currency
The ComboBox RowSource is SELECT [tblProblem].[ID], [tblProblem].[Task],
[tblProblem].[Rate] FROM tblProblem;

I need to select a Problem from the ComboBox and the [Rate] field
automatically populate.
I am using Access 2007.
I have tried a few variants of the following but cannot get get the field
to populate.
"Me!Rate = Me!Problem.Column(3
I know this is a common ground question but I cannot get the Value to
populate the text boxe.

Any Help Please

Regards
John
 
J

John

Hi
The combobox is bound to the field [Rate] so the column 3 is shown and
stored there.
I have tried all the methods you have given but no luck on populating the
field [Task]
The first equals sign was a mistake, sorry.
The code is in the code section as Me.[Task].Value =
Me.[cboProblem].column(2)
Still no luck.
Obviously you can only have one bound field assigned to the combobox but I
still cannot populate the second textbox [Task]

Any help here guys please would be most appreciated..

Regards

John




Ofer Cohen said:
1. If the fields are UnBound the value won't be stored in the table, if
you
want them to be stored in the table, bound the text box to the fields in
the
table

2. Check the combo ColumnCount property, do you have 3 in it?
If not, then the column 3 wont be recognised

3. Did you put this line In the code section?
(Code section mean, when the cursor located in the After update event of
the
combo, there is a button with three dots, press it and select code view)

=Me.[Task].Value = [cboProblem].[column](2)

If so, why do you have two equal signs?
try:
Me.[Task].Value = Me.[cboProblem].column(2)

---------------------------------------------------------------
Note: section 3 can be done after you check section 2
---------------------------------------------------------------

--
Good Luck
BS"D


John said:
Thanks for the replies guys.
Unfortuntely I can only get Kens method to work (Partially).
1 Bound field works great but I have now foun a need to have 2 fields
populated and any data in the unbound field is not stored in the Records
Source Table. Is it possible to have multiple bound fields based on the
combobox values.
I have tried using the =Me.[Task].Value = [cboProblem].[column](2) in the
After Update event of the ComboBox
but this produces nothing in the TextBox [Task]

Any further Ideas?

Kind Regards

John


Ken Snell (MVP) said:
See this article at The ACCESS Web site:
http://www.mvps.org/access/forms/frm0058.htm

--

Ken Snell
<MS ACCESS MVP>


Hi,
On my form "frmDetails", I have a ComboBox "cboProblem" and a field
[RATE]

The ComboBox looks up the values from the table tblProblem with 3
fields
[ID] [TASK] [RATE]
The 3 fields are formatted as AutoNumber, Text and Currency
The ComboBox RowSource is SELECT [tblProblem].[ID],
[tblProblem].[Task],
[tblProblem].[Rate] FROM tblProblem;

I need to select a Problem from the ComboBox and the [Rate] field
automatically populate.
I am using Access 2007.
I have tried a few variants of the following but cannot get get the
field
to populate.
"Me!Rate = Me!Problem.Column(3
I know this is a common ground question but I cannot get the Value to
populate the text boxe.

Any Help Please

Regards
John
 
K

Ken Snell \(MVP\)

Post the code that you're using to set the value in the textbox.

--

Ken Snell
<MS ACCESS MVP>

John said:
Hi
The combobox is bound to the field [Rate] so the column 3 is shown and
stored there.
I have tried all the methods you have given but no luck on populating the
field [Task]
The first equals sign was a mistake, sorry.
The code is in the code section as Me.[Task].Value =
Me.[cboProblem].column(2)
Still no luck.
Obviously you can only have one bound field assigned to the combobox but I
still cannot populate the second textbox [Task]

Any help here guys please would be most appreciated..

Regards

John




Ofer Cohen said:
1. If the fields are UnBound the value won't be stored in the table, if
you
want them to be stored in the table, bound the text box to the fields in
the
table

2. Check the combo ColumnCount property, do you have 3 in it?
If not, then the column 3 wont be recognised

3. Did you put this line In the code section?
(Code section mean, when the cursor located in the After update event of
the
combo, there is a button with three dots, press it and select code view)

=Me.[Task].Value = [cboProblem].[column](2)

If so, why do you have two equal signs?
try:
Me.[Task].Value = Me.[cboProblem].column(2)

---------------------------------------------------------------
Note: section 3 can be done after you check section 2
---------------------------------------------------------------

--
Good Luck
BS"D


John said:
Thanks for the replies guys.
Unfortuntely I can only get Kens method to work (Partially).
1 Bound field works great but I have now foun a need to have 2 fields
populated and any data in the unbound field is not stored in the Records
Source Table. Is it possible to have multiple bound fields based on the
combobox values.
I have tried using the =Me.[Task].Value = [cboProblem].[column](2) in
the
After Update event of the ComboBox
but this produces nothing in the TextBox [Task]

Any further Ideas?

Kind Regards

John


See this article at The ACCESS Web site:
http://www.mvps.org/access/forms/frm0058.htm

--

Ken Snell
<MS ACCESS MVP>


Hi,
On my form "frmDetails", I have a ComboBox "cboProblem" and a field
[RATE]

The ComboBox looks up the values from the table tblProblem with 3
fields
[ID] [TASK] [RATE]
The 3 fields are formatted as AutoNumber, Text and Currency
The ComboBox RowSource is SELECT [tblProblem].[ID],
[tblProblem].[Task],
[tblProblem].[Rate] FROM tblProblem;

I need to select a Problem from the ComboBox and the [Rate] field
automatically populate.
I am using Access 2007.
I have tried a few variants of the following but cannot get get the
field
to populate.
"Me!Rate = Me!Problem.Column(3
I know this is a common ground question but I cannot get the Value to
populate the text boxe.

Any Help Please

Regards
John
 
J

John

Ken,
I have tried
Me.[Task].Value = Me.[cboProblem].column(2)
Me!Task.Value = Me!cboProblem.column(2)
Me![Task].Value = Me![cboProblem].column(2)

The combobox is bound to the field [Rate] and the value is populated
perfectly from [cboProblem].column(3) using the code
SELECT [tblProblem].[ID], [tblProblem].[Task], [tblProblem].[Rate] FROM
tblProblem;

The data in column(2) needs to populate the field [Task]

1 Thing, I am using Access 2007 and I have used this method in Access 2002,
2003 and no problems. Could this be a 2007 issue?

Regards

John




Ken Snell (MVP) said:
Post the code that you're using to set the value in the textbox.

--

Ken Snell
<MS ACCESS MVP>

John said:
Hi
The combobox is bound to the field [Rate] so the column 3 is shown and
stored there.
I have tried all the methods you have given but no luck on populating the
field [Task]
The first equals sign was a mistake, sorry.
The code is in the code section as Me.[Task].Value =
Me.[cboProblem].column(2)
Still no luck.
Obviously you can only have one bound field assigned to the combobox but
I still cannot populate the second textbox [Task]

Any help here guys please would be most appreciated..

Regards

John




Ofer Cohen said:
1. If the fields are UnBound the value won't be stored in the table, if
you
want them to be stored in the table, bound the text box to the fields in
the
table

2. Check the combo ColumnCount property, do you have 3 in it?
If not, then the column 3 wont be recognised

3. Did you put this line In the code section?
(Code section mean, when the cursor located in the After update event of
the
combo, there is a button with three dots, press it and select code view)

=Me.[Task].Value = [cboProblem].[column](2)

If so, why do you have two equal signs?
try:
Me.[Task].Value = Me.[cboProblem].column(2)

---------------------------------------------------------------
Note: section 3 can be done after you check section 2
---------------------------------------------------------------

--
Good Luck
BS"D


:

Thanks for the replies guys.
Unfortuntely I can only get Kens method to work (Partially).
1 Bound field works great but I have now foun a need to have 2 fields
populated and any data in the unbound field is not stored in the
Records
Source Table. Is it possible to have multiple bound fields based on
the
combobox values.
I have tried using the =Me.[Task].Value = [cboProblem].[column](2) in
the
After Update event of the ComboBox
but this produces nothing in the TextBox [Task]

Any further Ideas?

Kind Regards

John


See this article at The ACCESS Web site:
http://www.mvps.org/access/forms/frm0058.htm

--

Ken Snell
<MS ACCESS MVP>


Hi,
On my form "frmDetails", I have a ComboBox "cboProblem" and a field
[RATE]

The ComboBox looks up the values from the table tblProblem with 3
fields
[ID] [TASK] [RATE]
The 3 fields are formatted as AutoNumber, Text and Currency
The ComboBox RowSource is SELECT [tblProblem].[ID],
[tblProblem].[Task],
[tblProblem].[Rate] FROM tblProblem;

I need to select a Problem from the ComboBox and the [Rate] field
automatically populate.
I am using Access 2007.
I have tried a few variants of the following but cannot get get the
field
to populate.
"Me!Rate = Me!Problem.Column(3
I know this is a common ground question but I cannot get the Value
to
populate the text boxe.

Any Help Please

Regards
John
 
J

John

Ken
I have found that if you make the field [Task] control source
=[cboProblem].[column](2) it populates but obviously will not store the
data.

Regards

John

John said:
Ken,
I have tried
Me.[Task].Value = Me.[cboProblem].column(2)
Me!Task.Value = Me!cboProblem.column(2)
Me![Task].Value = Me![cboProblem].column(2)

The combobox is bound to the field [Rate] and the value is populated
perfectly from [cboProblem].column(3) using the code
SELECT [tblProblem].[ID], [tblProblem].[Task], [tblProblem].[Rate] FROM
tblProblem;

The data in column(2) needs to populate the field [Task]

1 Thing, I am using Access 2007 and I have used this method in Access
2002, 2003 and no problems. Could this be a 2007 issue?

Regards

John




Ken Snell (MVP) said:
Post the code that you're using to set the value in the textbox.

--

Ken Snell
<MS ACCESS MVP>

John said:
Hi
The combobox is bound to the field [Rate] so the column 3 is shown and
stored there.
I have tried all the methods you have given but no luck on populating
the field [Task]
The first equals sign was a mistake, sorry.
The code is in the code section as Me.[Task].Value =
Me.[cboProblem].column(2)
Still no luck.
Obviously you can only have one bound field assigned to the combobox but
I still cannot populate the second textbox [Task]

Any help here guys please would be most appreciated..

Regards

John




1. If the fields are UnBound the value won't be stored in the table, if
you
want them to be stored in the table, bound the text box to the fields
in the
table

2. Check the combo ColumnCount property, do you have 3 in it?
If not, then the column 3 wont be recognised

3. Did you put this line In the code section?
(Code section mean, when the cursor located in the After update event
of the
combo, there is a button with three dots, press it and select code
view)

=Me.[Task].Value = [cboProblem].[column](2)

If so, why do you have two equal signs?
try:
Me.[Task].Value = Me.[cboProblem].column(2)

---------------------------------------------------------------
Note: section 3 can be done after you check section 2
---------------------------------------------------------------

--
Good Luck
BS"D


:

Thanks for the replies guys.
Unfortuntely I can only get Kens method to work (Partially).
1 Bound field works great but I have now foun a need to have 2 fields
populated and any data in the unbound field is not stored in the
Records
Source Table. Is it possible to have multiple bound fields based on
the
combobox values.
I have tried using the =Me.[Task].Value = [cboProblem].[column](2) in
the
After Update event of the ComboBox
but this produces nothing in the TextBox [Task]

Any further Ideas?

Kind Regards

John


See this article at The ACCESS Web site:
http://www.mvps.org/access/forms/frm0058.htm

--

Ken Snell
<MS ACCESS MVP>


Hi,
On my form "frmDetails", I have a ComboBox "cboProblem" and a field
[RATE]

The ComboBox looks up the values from the table tblProblem with 3
fields
[ID] [TASK] [RATE]
The 3 fields are formatted as AutoNumber, Text and Currency
The ComboBox RowSource is SELECT [tblProblem].[ID],
[tblProblem].[Task],
[tblProblem].[Rate] FROM tblProblem;

I need to select a Problem from the ComboBox and the [Rate] field
automatically populate.
I am using Access 2007.
I have tried a few variants of the following but cannot get get the
field
to populate.
"Me!Rate = Me!Problem.Column(3
I know this is a common ground question but I cannot get the Value
to
populate the text boxe.

Any Help Please

Regards
John
 
G

Guest

If the text box Task (not the combo box) in the form is not bounded (a field
defined in the control source of the text box) to the field in the table,
this value wont be stored in the table.

If the form record source include the table where the task field is located
in, then in the Task text box Control source choose the field from the table

--
Good Luck
BS"D


John said:
Ken
I have found that if you make the field [Task] control source
=[cboProblem].[column](2) it populates but obviously will not store the
data.

Regards

John

John said:
Ken,
I have tried
Me.[Task].Value = Me.[cboProblem].column(2)
Me!Task.Value = Me!cboProblem.column(2)
Me![Task].Value = Me![cboProblem].column(2)

The combobox is bound to the field [Rate] and the value is populated
perfectly from [cboProblem].column(3) using the code
SELECT [tblProblem].[ID], [tblProblem].[Task], [tblProblem].[Rate] FROM
tblProblem;

The data in column(2) needs to populate the field [Task]

1 Thing, I am using Access 2007 and I have used this method in Access
2002, 2003 and no problems. Could this be a 2007 issue?

Regards

John




Ken Snell (MVP) said:
Post the code that you're using to set the value in the textbox.

--

Ken Snell
<MS ACCESS MVP>

Hi
The combobox is bound to the field [Rate] so the column 3 is shown and
stored there.
I have tried all the methods you have given but no luck on populating
the field [Task]
The first equals sign was a mistake, sorry.
The code is in the code section as Me.[Task].Value =
Me.[cboProblem].column(2)
Still no luck.
Obviously you can only have one bound field assigned to the combobox but
I still cannot populate the second textbox [Task]

Any help here guys please would be most appreciated..

Regards

John




1. If the fields are UnBound the value won't be stored in the table, if
you
want them to be stored in the table, bound the text box to the fields
in the
table

2. Check the combo ColumnCount property, do you have 3 in it?
If not, then the column 3 wont be recognised

3. Did you put this line In the code section?
(Code section mean, when the cursor located in the After update event
of the
combo, there is a button with three dots, press it and select code
view)

=Me.[Task].Value = [cboProblem].[column](2)

If so, why do you have two equal signs?
try:
Me.[Task].Value = Me.[cboProblem].column(2)

---------------------------------------------------------------
Note: section 3 can be done after you check section 2
---------------------------------------------------------------

--
Good Luck
BS"D


:

Thanks for the replies guys.
Unfortuntely I can only get Kens method to work (Partially).
1 Bound field works great but I have now foun a need to have 2 fields
populated and any data in the unbound field is not stored in the
Records
Source Table. Is it possible to have multiple bound fields based on
the
combobox values.
I have tried using the =Me.[Task].Value = [cboProblem].[column](2) in
the
After Update event of the ComboBox
but this produces nothing in the TextBox [Task]

Any further Ideas?

Kind Regards

John


See this article at The ACCESS Web site:
http://www.mvps.org/access/forms/frm0058.htm

--

Ken Snell
<MS ACCESS MVP>


Hi,
On my form "frmDetails", I have a ComboBox "cboProblem" and a field
[RATE]

The ComboBox looks up the values from the table tblProblem with 3
fields
[ID] [TASK] [RATE]
The 3 fields are formatted as AutoNumber, Text and Currency
The ComboBox RowSource is SELECT [tblProblem].[ID],
[tblProblem].[Task],
[tblProblem].[Rate] FROM tblProblem;

I need to select a Problem from the ComboBox and the [Rate] field
automatically populate.
I am using Access 2007.
I have tried a few variants of the following but cannot get get the
field
to populate.
"Me!Rate = Me!Problem.Column(3
I know this is a common ground question but I cannot get the Value
to
populate the text boxe.

Any Help Please

Regards
John
 
J

John

Hi Guys,
Thanks for all your help here but I am obviously getting no where.

I fully understand that you have to have a field bound to its record source
to store data.
All I am saying is that what ever I put in as code i the after update event
of the combobox, nothing is populated.
I have just recreated all my steps and all your suggestions on an access
2002/2003 database and everything is great.
It will just not work in access 2007

I give in and will reinstall access 2003

Thanks again for all your help.

Kind Regards

John




Ofer Cohen said:
If the text box Task (not the combo box) in the form is not bounded (a
field
defined in the control source of the text box) to the field in the table,
this value wont be stored in the table.

If the form record source include the table where the task field is
located
in, then in the Task text box Control source choose the field from the
table

--
Good Luck
BS"D


John said:
Ken
I have found that if you make the field [Task] control source
=[cboProblem].[column](2) it populates but obviously will not store the
data.

Regards

John

John said:
Ken,
I have tried
Me.[Task].Value = Me.[cboProblem].column(2)
Me!Task.Value = Me!cboProblem.column(2)
Me![Task].Value = Me![cboProblem].column(2)

The combobox is bound to the field [Rate] and the value is populated
perfectly from [cboProblem].column(3) using the code
SELECT [tblProblem].[ID], [tblProblem].[Task], [tblProblem].[Rate] FROM
tblProblem;

The data in column(2) needs to populate the field [Task]

1 Thing, I am using Access 2007 and I have used this method in Access
2002, 2003 and no problems. Could this be a 2007 issue?

Regards

John




Post the code that you're using to set the value in the textbox.

--

Ken Snell
<MS ACCESS MVP>

Hi
The combobox is bound to the field [Rate] so the column 3 is shown
and
stored there.
I have tried all the methods you have given but no luck on populating
the field [Task]
The first equals sign was a mistake, sorry.
The code is in the code section as Me.[Task].Value =
Me.[cboProblem].column(2)
Still no luck.
Obviously you can only have one bound field assigned to the combobox
but
I still cannot populate the second textbox [Task]

Any help here guys please would be most appreciated..

Regards

John




1. If the fields are UnBound the value won't be stored in the table,
if
you
want them to be stored in the table, bound the text box to the
fields
in the
table

2. Check the combo ColumnCount property, do you have 3 in it?
If not, then the column 3 wont be recognised

3. Did you put this line In the code section?
(Code section mean, when the cursor located in the After update
event
of the
combo, there is a button with three dots, press it and select code
view)

=Me.[Task].Value = [cboProblem].[column](2)

If so, why do you have two equal signs?
try:
Me.[Task].Value = Me.[cboProblem].column(2)

---------------------------------------------------------------
Note: section 3 can be done after you check section 2
---------------------------------------------------------------

--
Good Luck
BS"D


:

Thanks for the replies guys.
Unfortuntely I can only get Kens method to work (Partially).
1 Bound field works great but I have now foun a need to have 2
fields
populated and any data in the unbound field is not stored in the
Records
Source Table. Is it possible to have multiple bound fields based
on
the
combobox values.
I have tried using the =Me.[Task].Value = [cboProblem].[column](2)
in
the
After Update event of the ComboBox
but this produces nothing in the TextBox [Task]

Any further Ideas?

Kind Regards

John


message
See this article at The ACCESS Web site:
http://www.mvps.org/access/forms/frm0058.htm

--

Ken Snell
<MS ACCESS MVP>


Hi,
On my form "frmDetails", I have a ComboBox "cboProblem" and a
field
[RATE]

The ComboBox looks up the values from the table tblProblem with
3
fields
[ID] [TASK] [RATE]
The 3 fields are formatted as AutoNumber, Text and Currency
The ComboBox RowSource is SELECT [tblProblem].[ID],
[tblProblem].[Task],
[tblProblem].[Rate] FROM tblProblem;

I need to select a Problem from the ComboBox and the [Rate]
field
automatically populate.
I am using Access 2007.
I have tried a few variants of the following but cannot get get
the
field
to populate.
"Me!Rate = Me!Problem.Column(3
I know this is a common ground question but I cannot get the
Value
to
populate the text boxe.

Any Help Please

Regards
John
 

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

Top