From: BruceM via AccessMonster.com on
The Column property of a combo box depends on its Row Source. You can change
the Row Source dynamically, but you cannot reassign the value of a single
field in the Row Source as you are trying to do.

You can do it the other way around, where you display the contents of columns
other than the visible one:

Me.ContractAcct = Me.cboContractAccount.Column(1)

Are you trying to find a record, or are you starting a new record? You speak
of populating the rest of the fields based on the combo box selection, but
generally that is not necessary except for historical data such as Unit Price
or Exchange Rate or somethng of the sort that is subject to change, but where
you want the record to reflect the value at the time the record was created,
not the current value.

Duncs wrote:
>I've tried.Column(1), I've tried .Text, I've tried everything I can
>think of, but nothing seems to work.
>
>I can't get a value assigned to the either of these combo controls.
>
>Can someone help?
>
>Many TIA
>
>Duncs
>
>> Arvin,
>>
>[quoted text clipped - 73 lines]
>>
>> - Show quoted text -

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/201003/1

From: JOSIDIS on


"Duncs" <true.kilted.scot(a)gmail.com> a �crit dans le message de groupe de
discussion :
d9f9073f-bbc2-456d-8249-08ba1409db6b(a)19g2000yqu.googlegroups.com...
> I've tried.Column(1), I've tried .Text, I've tried everything I can
> think of, but nothing seems to work.
>
> I can't get a value assigned to the either of these combo controls.
>
> Can someone help?
>
> Many TIA
>
> Duncs
>
>
> On 25 Feb, 10:53, Duncs <true.kilted.s...(a)gmail.com> wrote:
>> Arvin,
>>
>> Thanks for your suggestion. I've now changed the code as follows:
>>
>> With Form
>> .cboContractAccount.Column(1) = ContractAcct
>> .cboSerial.Column(1) = SerialNum
>>
>> But, when I run this, I am getting an error on the first assignment as
>> follows:
>>
>> Err.number - 424
>> Err.Description - Object required
>>
>> The code is in a 'DisplayRecord' routine that populates a form of
>> unbouond fields with the results of a query..
>>
>> If I select an account number from the combo, when it enters the
>> routine, Form.cboContractAccount.Column(1) = 850034630569, which is
>> the value selected in the dropdown. The ContractAcct value passed is
>> 850034630569. So, normal code execution is:
>>
>> Select value
>> Retrieve data
>> Display data
>>
>> However, with the two combos, I can't get them to show / retain the
>> value passed.
>>
>> Help!!
>>
>> Duncs
>>
>> On 23 Feb, 12:54, "Arvin Meyer [MVP]" <arv...(a)mvps.invalid> wrote:
>>
>>
>>
>> > Use the column property of the combo. Say the serial number is in the
>> > 4th
>> > column:
>>
>> > Me.cboContractAccount.Column(3)
>>
>> > The column index is zero based.
>> > --
>> > Arvin Meyer, MCP,
>> > MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmv...
>>
>> > "Duncs" <true.kilted.s...(a)gmail.com> wrote in message
>>
>> >news:1c406a13-e040-4988-b768-0efc3229f8fb(a)v20g2000yqv.googlegroups.com...
>>
>> > >I have a form with two unbound combo boxes, and several fields.
>>
>> > > The idea of the form is that the user can select either of the two
>> > > combo's and the rest of the fields on the form will populate.
>>
>> > > So, for example, if the user selects an entry from
>> > > cboContractAccount,
>> > > the table will be searched and the fields populated with the values
>> > > associated with that ContractAccount. Alternatively, the user can
>> > > select an entry from cboSerialNum--if they don't know the
>> > > ContractAccount--and the fields will populate as appropriate.
>>
>> > > However what I want to do is, if they select a ContractAccount from
>> > > cboContractAccount, I want cboSerialNum to populate with the serial
>> > > number for that record, and vice-versa. I've tried using:
>>
>> > > .cboContractAccount.Value = ContractAcct
>>
>> > > Where ContractAccount is the value retrieved from the database. In
>> > > debug mode, ContractAcct shows ''85002312542'
>> > > and .cboContractAccount.Value shows ''85002312542'. But, on the
>> > > form,
>> > > cboContractAccount is blank.
>>
>> > > Anyone advise?
>>
>> > > TIA
>>
>> > > Duncs- Hide quoted text -
>>
>> > - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
>
From: KenSheridan via AccessMonster.com on
Post the RowSource properties of the two combo boxes.

You need to make sure that whatever is the BoundColumn of each combo box is
included as a column in the RowSource property of the other. You can then,
in the AfterUpdate event procedure of each, assign the value of the relevant
column to the other control.

Ken Sheridan
Stafford, England

Duncs wrote:
>I've tried.Column(1), I've tried .Text, I've tried everything I can
>think of, but nothing seems to work.
>
>I can't get a value assigned to the either of these combo controls.
>
>Can someone help?
>
>Many TIA
>
>Duncs
>
>> Arvin,
>>
>[quoted text clipped - 73 lines]
>>
>> - Show quoted text -

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/201003/1

From: Duncs on
Ken, I've decided to re-think my idea. Perhaps what I'm trying to do
is too complex, or can be achieved an easier way.

I may however, re-visit this idea, so I'll be sure to shout out if I
get stuck!!

Many thanks for everyones help with this.

Duncs

On 8 Mar, 20:58, "KenSheridan via AccessMonster.com" <u51882(a)uwe>
wrote:
> Post the RowSource properties of the two combo boxes.
>
> You need to make sure that whatever is the  BoundColumn of each combo box is
> included as a column in the RowSource property of the other.  You can then,
> in the AfterUpdate event procedure of each, assign the value of the relevant
> column to the other control.
>
> Ken Sheridan
> Stafford, England
>
>
>
>
>
> Duncs wrote:
> >I've tried.Column(1), I've tried .Text, I've tried everything I can
> >think of, but nothing seems to work.
>
> >I can't get a value assigned to the either of these combo controls.
>
> >Can someone help?
>
> >Many TIA
>
> >Duncs
>
> >> Arvin,
>
> >[quoted text clipped - 73 lines]
>
> >> - Show quoted text -
>
> --
> Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access/201003/1- Hide quoted text -
>
> - Show quoted text -

From: De Jager on

<david.tickle8(a)virginmedia.com> wrote in message
news:uV1atjOtKHA.712(a)TK2MSFTNGP04.phx.gbl...
> davidtickle
>
> "Duncs" <true.kilted.scot(a)gmail.com> wrote in message
> news:1c406a13-e040-4988-b768-0efc3229f8fb(a)v20g2000yqv.googlegroups.com...
>> I have a form with two unbound combo boxes, and several fields.
>>
>> The idea of the form is that the user can select either of the two
>> combo's and the rest of the fields on the form will populate.
>>
>> So, for example, if the user selects an entry from cboContractAccount,
>> the table will be searched and the fields populated with the values
>> associated with that ContractAccount. Alternatively, the user can
>> select an entry from cboSerialNum--if they don't know the
>> ContractAccount--and the fields will populate as appropriate.
>>
>> However what I want to do is, if they select a ContractAccount from
>> cboContractAccount, I want cboSerialNum to populate with the serial
>> number for that record, and vice-versa. I've tried using:
>>
>> .cboContractAccount.Value = ContractAcct
>>
>> Where ContractAccount is the value retrieved from the database. In
>> debug mode, ContractAcct shows ''85002312542'
>> and .cboContractAccount.Value shows ''85002312542'. But, on the form,
>> cboContractAccount is blank.
>>
>> Anyone advise?
>>
>> TIA
>>
>> Duncs
>