PC Review


Reply
Thread Tools Rate Thread

Combo Box to enter data to text box!

 
 
Bob Vance
Guest
Posts: n/a
 
      31st Dec 2009
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
--
Thanks in advance for any help with this......Bob
MS Access 2007 accdb
Windows XP Home Edition Ver 5.1 Service Pack 3


 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      31st Dec 2009
On Fri, 1 Jan 2010 11:49:12 +1300, "Bob Vance" <(E-Mail Removed)> wrote:

>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?
--

John W. Vinson [MVP]
 
Reply With Quote
 
Steve
Guest
Posts: n/a
 
      31st Dec 2009
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 Removed)



"Bob Vance" <(E-Mail Removed)> wrote in message
news:(E-Mail 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
> --
> Thanks in advance for any help with this......Bob
> MS Access 2007 accdb
> Windows XP Home Edition Ver 5.1 Service Pack 3
>
>



 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      31st Dec 2009

"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:(E-Mail Removed)...
> On Fri, 1 Jan 2010 11:49:12 +1300, "Bob Vance" <(E-Mail Removed)> wrote:
>
>>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?
> --
>
> John W. Vinson [MVP]


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


 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      1st Jan 2010
Brilliant Steve , also can keep what is in there, regards Bob

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

"Steve" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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 Removed)
>
>
>
> "Bob Vance" <(E-Mail Removed)> wrote in message
> news:(E-Mail 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
>> --
>> Thanks in advance for any help with this......Bob
>> MS Access 2007 accdb
>> Windows XP Home Edition Ver 5.1 Service Pack 3
>>
>>

>
>



 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      1st Jan 2010
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Brilliant Steve , also can keep what is in there, regards Bob
>
> Me!tbAdditionCharge = tbAdditionCharge.value & "- " &
> Me!cmbHorseName.Column(1)
>
> "Steve" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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 Removed)
>>
>>
>>
>> "Bob Vance" <(E-Mail Removed)> wrote in message
>> news:(E-Mail 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
>>> --
>>> Thanks in advance for any help with this......Bob
>>> MS Access 2007 accdb
>>> Windows XP Home Edition Ver 5.1 Service Pack 3
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      1st Jan 2010
On Fri, 1 Jan 2010 12:51:06 +1300, "Bob Vance" <(E-Mail Removed)> wrote:

>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.

--

John W. Vinson [MVP]
 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      1st Jan 2010
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" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:(E-Mail Removed)...
> On Fri, 1 Jan 2010 12:51:06 +1300, "Bob Vance" <(E-Mail Removed)> wrote:
>
>>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.
>
> --
>
> John W. Vinson [MVP]



 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      1st Jan 2010
On Fri, 1 Jan 2010 23:47:27 +1300, "Bob Vance" <(E-Mail Removed)> wrote:

>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.
--

John W. Vinson [MVP]
 
Reply With Quote
 
Steve
Guest
Posts: n/a
 
      1st Jan 2010
Bob,

Your question is not clear. Please reword your question.

Steve


"Bob Vance" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Brilliant Steve , also can keep what is in there, regards Bob
>>
>> Me!tbAdditionCharge = tbAdditionCharge.value & "- " &
>> Me!cmbHorseName.Column(1)
>>
>> "Steve" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> 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 Removed)
>>>
>>>
>>>
>>> "Bob Vance" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail 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
>>>> --
>>>> Thanks in advance for any help with this......Bob
>>>> MS Access 2007 accdb
>>>> Windows XP Home Edition Ver 5.1 Service Pack 3
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Box gets focus but I can't enter data??? =?Utf-8?B?TmF0aGFuLWJmaGQ=?= Microsoft Access Form Coding 13 18th May 2007 06:21 PM
Enter text in a combo box? =?Utf-8?B?a2FpdHJvbl9n?= Microsoft Access 2 6th Mar 2007 08:51 PM
Enter text in a combo box? =?Utf-8?B?a2FpdHJvbl9n?= Microsoft Access Database Table Design 1 6th Mar 2007 08:47 PM
Be able to enter data ALSO in a COMBO BOX drop down =?Utf-8?B?Q29ubmll?= Microsoft Excel Worksheet Functions 1 22nd Feb 2007 09:15 PM
How do to enter data in a combo box on a worksheet? =?Utf-8?B?U2hlcmVlbg==?= Microsoft Excel Misc 1 1st Aug 2005 10:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:45 PM.