Hi Nick,
Thanks for taking the time to reply.
Please read below:
"Biz Enhancer" <(E-Mail Removed)> wrote in message
news:C0C97158-BC3C-4DD0-A5CB-(E-Mail Removed)...
> Hi JK,
>
> A couple of questions for you first.
> 1. Why base the combo on the query, why not base it on the table?
No particular reason, other than habit, I guess. I have the queries for
other purposes - I can change the base of the combos and see whether that
will produce the deisred result (I can't reemember whether I ever tried to
solve the problem in this way)
> 2. How are you specifying the forecolour - VBA? If so, on what event?
Both VBA and using the Combo properties prduces the same resluts. The
Evnt is AfterUpdate of an Option Group (see blow), or OnOpen (Form).
> 3. Would you be better using conditional formatting?
>
> If you are wanting to change the forecolour based on the value of the
> selection in the combo, have a look at using conditional formatting or set
> it
> via VBA on the change event.
> If you are setting the value via VBA then please post the code.
Every form has 2 modes which are controlled by Option Buttons
1.Edit Mode: User can edit/Add/Delete, using the With Statement:
(For each Field on the form)
With Me.MyField
.Locked=False
.Enabled=True
.ForeColor=vbBlack
End With
(Edit Button is hidden from users without appropriate authority)
2. View Mode: User can only view the form
With Me.MyField
.Locked=True
.Enabled=False
.ForeColor=vbBlue
End With
Regards
Jacob
>
> Regards,
>
> Nick.
> "JK" wrote:
>
>> I have asked this question before and had no takers :-(
>>
>> Example:
>>
>> Combo is base on a query which in turn based on a table eg:
>>
>> tblCountries:
>> Country_ID (key)
>> Country (text) eg: "Australia"
>> ShortName (Text) eg: "Aus"
>> etc.
>>
>> qryCountries:
>> SELECT Country,SHORTNAME,Country_ID FROM tblCountries
>>
>> Combo:
>> SELECT SHORTNAME, Country,Country_ID FROM qryCountries
>>
>> (Upper case is only for emphasis here)
>> (Please note "ShortName" is the *second* column in the query)
>>
>> When I specify the "ForeColor" of the combo box to ,say, vbBlue, the
>> colour
>> does *not *change (no errors).
>> HOWEVER, if I change Column(0) in the Combo to "Country" - no problems.
>>
>> Sure, I can duplicate the query changing the first field of the *query*
>> to
>> Column(0) of the combo box. I am trying to avoid it as this will entail
>> duplication of quite a few queries.
>>
>> I hope that explained it better.
>>
>> Any suggestions? (including "no can do")
>>
>> Regards/JK
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
|