Combo Box to enter data to text box!

B

Bob Vance

In my subForm I have a Combo box drop down list I want to have the data in
my combo box entered into my Text Box [tbAdditionCharge] on AfterUpdate
 
J

John W. Vinson

In my subForm I have a Combo box drop down list I want to have the data in
my combo box entered into my Text Box [tbAdditionCharge] on AfterUpdate

Since data is not stored in combo boxes, textboxes, subforms or forms, it's
not at all clear what you're asking!

What's the Recordsource of the subform? Post the SQL if it's a query. What's
the Row Source of the combo? Ditto. What data do you want to retrieve from the
combo? What should happen when it's "entered into" the textbox - just display
it, store it (redundantly?) in a table, or what?
 
S

Steve

You need to look at the rowsource of the combobox and see what column
contaibs the data you want to enter into the textbox. Keep in mind that the
columns of a combobox are zero based so start at zero when counting the
columns in the rowsource. Say the data you want is in the second column of
the rowsource; the second column would be Column(1) of the combobox. The
expression to use in the AfterUpdate event would be:
Me!NameOfTextbox = Me!NameOfCombobox.Column(1)

Steve
(e-mail address removed)
 
B

Bob Vance

John W. Vinson said:
In my subForm I have a Combo box drop down list I want to have the data in
my combo box entered into my Text Box [tbAdditionCharge] on AfterUpdate

Since data is not stored in combo boxes, textboxes, subforms or forms,
it's
not at all clear what you're asking!

What's the Recordsource of the subform? Post the SQL if it's a query.
What's
the Row Source of the combo? Ditto. What data do you want to retrieve from
the
combo? What should happen when it's "entered into" the textbox - just
display
it, store it (redundantly?) in a table, or what?

Thanks John the row source to the combo box is a query record source, it
shows the Horses Name
SELECT tblHorseInfo.HorseID, funGetHorse(0,tblHorseInfo.HorseID,False) AS
Name
FROM tblHorseInfo
WHERE (((tblHorseInfo.Status) Like 'Active*'))
ORDER BY funGetHorse(0,tblHorseInfo.HorseID,True),
funGetHorse(0,tblHorseInfo.HorseID,False);

The text box in the SubForm saves to a table under AdditionalCharges/Text
Field
the record source is TmpAddionalCharge
Wanted it to be saved to tmpAddionalCharge
Regards Bob
 
B

Bob Vance

Brilliant Steve , also can keep what is in there, regards Bob

Me!tbAdditionCharge = tbAdditionCharge.value & "- " &
Me!cmbHorseName.Column(1)

Steve said:
You need to look at the rowsource of the combobox and see what column
contaibs the data you want to enter into the textbox. Keep in mind that
the columns of a combobox are zero based so start at zero when counting
the columns in the rowsource. Say the data you want is in the second
column of the rowsource; the second column would be Column(1) of the
combobox. The expression to use in the AfterUpdate event would be:
Me!NameOfTextbox = Me!NameOfCombobox.Column(1)

Steve
(e-mail address removed)



Bob Vance said:
In my subForm I have a Combo box drop down list I want to have the data
in my combo box entered into my Text Box [tbAdditionCharge] on
AfterUpdate
 
B

Bob Vance

trying to get the form to make the control visible when I open it, but am
getting the error ,cant find subAdditionCharge which is the sub form? The
control is set to no visible
Regards Bob

Forms!subAdditionCharge!cmbHorseName.Visible = True
Bob Vance said:
Brilliant Steve , also can keep what is in there, regards Bob

Me!tbAdditionCharge = tbAdditionCharge.value & "- " &
Me!cmbHorseName.Column(1)

Steve said:
You need to look at the rowsource of the combobox and see what column
contaibs the data you want to enter into the textbox. Keep in mind that
the columns of a combobox are zero based so start at zero when counting
the columns in the rowsource. Say the data you want is in the second
column of the rowsource; the second column would be Column(1) of the
combobox. The expression to use in the AfterUpdate event would be:
Me!NameOfTextbox = Me!NameOfCombobox.Column(1)

Steve
(e-mail address removed)



Bob Vance said:
In my subForm I have a Combo box drop down list I want to have the data
in my combo box entered into my Text Box [tbAdditionCharge] on
AfterUpdate
 
J

John W. Vinson

Thanks John the row source to the combo box is a query record source, it
shows the Horses Name
SELECT tblHorseInfo.HorseID, funGetHorse(0,tblHorseInfo.HorseID,False) AS
Name
FROM tblHorseInfo
WHERE (((tblHorseInfo.Status) Like 'Active*'))
ORDER BY funGetHorse(0,tblHorseInfo.HorseID,True),
funGetHorse(0,tblHorseInfo.HorseID,False);

The text box in the SubForm saves to a table under AdditionalCharges/Text
Field
the record source is TmpAddionalCharge
Wanted it to be saved to tmpAddionalCharge
Regards Bob

What is the real-world meaning of tmpAddionalCharge? an "add[t]ional charge"?
What should be stored in that field? A HorseID, a horse's name? If so, why?
What purpose does this serve?

I'm simply not understanding what you're trying to accomplish.
 
B

Bob Vance

I just picked up on a query to enter a horses name into a text box that is
part of a subform for charges to a owner, so instead of typing the horses
name you could just select it from a a combobox drop down list , it just so
happened to have HorseID in the query not that i needed it, some names are
very long and compilicated to type
Regards Bob

John W. Vinson said:
Thanks John the row source to the combo box is a query record source, it
shows the Horses Name
SELECT tblHorseInfo.HorseID, funGetHorse(0,tblHorseInfo.HorseID,False) AS
Name
FROM tblHorseInfo
WHERE (((tblHorseInfo.Status) Like 'Active*'))
ORDER BY funGetHorse(0,tblHorseInfo.HorseID,True),
funGetHorse(0,tblHorseInfo.HorseID,False);

The text box in the SubForm saves to a table under AdditionalCharges/Text
Field
the record source is TmpAddionalCharge
Wanted it to be saved to tmpAddionalCharge
Regards Bob

What is the real-world meaning of tmpAddionalCharge? an "add[t]ional
charge"?
What should be stored in that field? A HorseID, a horse's name? If so,
why?
What purpose does this serve?

I'm simply not understanding what you're trying to accomplish.
 
J

John W. Vinson

I just picked up on a query to enter a horses name into a text box that is
part of a subform for charges to a owner, so instead of typing the horses
name you could just select it from a a combobox drop down list , it just so
happened to have HorseID in the query not that i needed it, some names are
very long and compilicated to type

Bob, I do understand the benefit of a combo box allowing you to select a name
rather than typing it in. I've been using Access for a while now.

But that was not what I was asking you.

What do you want to DO with the combo box?

Do you want to store the HorseID in some field?

Do you want to use the HorseID as a criterion in some other query?

Do you want to store the horse's name (redundantly) in some text field?

Do you want to just display the horse's name on the form?

Do you want to do something else?


Remember: we cannot see your database and we cannot read your mind; all we can
see is what you post here.
 
S

Steve

Bob,

Your question is not clear. Please reword your question.

Steve


Bob Vance said:
trying to get the form to make the control visible when I open it, but am
getting the error ,cant find subAdditionCharge which is the sub form? The
control is set to no visible
Regards Bob

Forms!subAdditionCharge!cmbHorseName.Visible = True
Bob Vance said:
Brilliant Steve , also can keep what is in there, regards Bob

Me!tbAdditionCharge = tbAdditionCharge.value & "- " &
Me!cmbHorseName.Column(1)

Steve said:
You need to look at the rowsource of the combobox and see what column
contaibs the data you want to enter into the textbox. Keep in mind that
the columns of a combobox are zero based so start at zero when counting
the columns in the rowsource. Say the data you want is in the second
column of the rowsource; the second column would be Column(1) of the
combobox. The expression to use in the AfterUpdate event would be:
Me!NameOfTextbox = Me!NameOfCombobox.Column(1)

Steve
(e-mail address removed)



In my subForm I have a Combo box drop down list I want to have the data
in my combo box entered into my Text Box [tbAdditionCharge] on
AfterUpdate
 
B

Bob Vance

Ken the problem is 2 forms are using the same subForm and I dont want the
(enter horse name) option available on one of the forms
Regards Bob Vance

KenSheridan via AccessMonster.com said:
Bob:

If you set up the subform and its table correctly as described in my other
reply, then the problem over visibility goes away, as you will use a
single
bound combo box in the subform, with its Visible property True (Yes).

Ken Sheridan
Stafford, England

Bob said:
trying to get the form to make the control visible when I open it, but am
getting the error ,cant find subAdditionCharge which is the sub form? The
control is set to no visible
Regards Bob

Forms!subAdditionCharge!cmbHorseName.Visible = True
Brilliant Steve , also can keep what is in there, regards Bob
[quoted text clipped - 15 lines]
in my combo box entered into my Text Box [tbAdditionCharge] on
AfterUpdate
 
G

Guest

iletide þunu yazdý said:
Brilliant Steve , also can keep what is in there, regards Bob

Me!tbAdditionCharge = tbAdditionCharge.value & "- " &
Me!cmbHorseName.Column(1)

Steve said:
You need to look at the rowsource of the combobox and see what column
contaibs the data you want to enter into the textbox. Keep in mind that
the columns of a combobox are zero based so start at zero when counting
the columns in the rowsource. Say the data you want is in the second
column of the rowsource; the second column would be Column(1) of the
combobox. The expression to use in the AfterUpdate event would be:
Me!NameOfTextbox = Me!NameOfCombobox.Column(1)

Steve
(e-mail address removed)



Bob Vance said:
In my subForm I have a Combo box drop down list I want to have the data
in my combo box entered into my Text Box [tbAdditionCharge] on
AfterUpdate
 
B

Bob Vance

Thanks Ken that did it :)
Regards Bob

KenSheridan via AccessMonster.com said:
Bob:

Would it not be simpler simply to have two versions of the subform, one
with
and one without the relevant control?

Ken Sheridan
Stafford, England

Bob said:
Ken the problem is 2 forms are using the same subForm and I dont want the
(enter horse name) option available on one of the forms
Regards Bob Vance
[quoted text clipped - 17 lines]
in my combo box entered into my Text Box [tbAdditionCharge] on
AfterUpdate
 
S

Shirley Seay

What is error 18597? It pops up periodically on my computer!


Bob,

Your question is not clear. Please reword your question.

Steve


Bob Vance said:
trying to get the form to make the control visible when I open it, but am
getting the error ,cant find subAdditionCharge which is the sub form? The
control is set to no visible
Regards Bob

Forms!subAdditionCharge!cmbHorseName.Visible = True
Bob Vance said:
Brilliant Steve , also can keep what is in there, regards Bob

Me!tbAdditionCharge = tbAdditionCharge.value & "- " &
Me!cmbHorseName.Column(1)

You need to look at the rowsource of the combobox and see what column
contaibs the data you want to enter into the textbox. Keep in mind that
the columns of a combobox are zero based so start at zero when counting
the columns in the rowsource. Say the data you want is in the second
column of the rowsource; the second column would be Column(1) of the
combobox. The expression to use in the AfterUpdate event would be:
Me!NameOfTextbox = Me!NameOfCombobox.Column(1)

Steve
(e-mail address removed)



In my subForm I have a Combo box drop down list I want to have the data
in my combo box entered into my Text Box [tbAdditionCharge] on
AfterUpdate
 
S

Steve

Shirley,

I don't recognize the error number. Is it an operating system error or an
Access error? When the error appears, write down the error description and
post it here.

Steve


Shirley Seay said:
What is error 18597? It pops up periodically on my computer!


Bob,

Your question is not clear. Please reword your question.

Steve


Bob Vance said:
trying to get the form to make the control visible when I open it, but
am
getting the error ,cant find subAdditionCharge which is the sub form?
The
control is set to no visible
Regards Bob

Forms!subAdditionCharge!cmbHorseName.Visible = True
Brilliant Steve , also can keep what is in there, regards Bob

Me!tbAdditionCharge = tbAdditionCharge.value & "- " &
Me!cmbHorseName.Column(1)

You need to look at the rowsource of the combobox and see what column
contaibs the data you want to enter into the textbox. Keep in mind
that
the columns of a combobox are zero based so start at zero when
counting
the columns in the rowsource. Say the data you want is in the second
column of the rowsource; the second column would be Column(1) of the
combobox. The expression to use in the AfterUpdate event would be:
Me!NameOfTextbox = Me!NameOfCombobox.Column(1)

Steve
(e-mail address removed)



In my subForm I have a Combo box drop down list I want to have the
data
in my combo box entered into my Text Box [tbAdditionCharge] on
AfterUpdate
 
R

Risse

Steve said:
Shirley,

I don't recognize the error number. Is it an operating system error or an
Access error? When the error appears, write down the error description and
post it here.

Steve


Shirley Seay said:
What is error 18597? It pops up periodically on my computer!


Bob,

Your question is not clear. Please reword your question.

Steve


trying to get the form to make the control visible when I open it, but
am
getting the error ,cant find subAdditionCharge which is the sub form?
The
control is set to no visible
Regards Bob

Forms!subAdditionCharge!cmbHorseName.Visible = True
Brilliant Steve , also can keep what is in there, regards Bob

Me!tbAdditionCharge = tbAdditionCharge.value & "- " &
Me!cmbHorseName.Column(1)

You need to look at the rowsource of the combobox and see what column
contaibs the data you want to enter into the textbox. Keep in mind
that
the columns of a combobox are zero based so start at zero when
counting
the columns in the rowsource. Say the data you want is in the second
column of the rowsource; the second column would be Column(1) of the
combobox. The expression to use in the AfterUpdate event would be:
Me!NameOfTextbox = Me!NameOfCombobox.Column(1)

Steve
(e-mail address removed)



In my subForm I have a Combo box drop down list I want to have the
data
in my combo box entered into my Text Box [tbAdditionCharge] on
AfterUpdate
 

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