Connecting Tech Pros Worldwide Help | Site Map

HELP: Conditional Formatting with VBA Code

Megan
Guest
 
Posts: n/a
#1: Nov 12 '05
Can you write conditional VBA code that affects only one or two
records on a continuous subform?

I have a form with a subform on it. The parent/ child field that links
the forms is CaseID. The main form has personal info on it. The
subform deals with each case's Issues, Decisions, and Notices.

Issues, Decisions, and Notices are all combo boxes. Not all Issues
have Notices. Issues 25-50 have Notices. Issues 1-24 and 51-100 don't
have Notices. I wrote a simple Case statement that makes the Notices
combo boxes visible only when an Issue between 25 and 50 is selected.
The VBA code works but has a drawback- the Notices combo boxes appear
in all of my records on my continuous subform when one of my Issues is
between 25 and 50.

For example, case 7 has 3 Issues. Issue#1 = 1, Issue#2 = 75, Issue#3 =
25. After I select an Issue between 25 and 50 for one of my Issues
combo boxes, the Notices combo boxes appear with each Issue, and I
only want the Notices combo box to be visible with Issue#3.

Is there a way to code it so that the Notices combo box only appears
on those records where the Issue is between 25 and 50? Or is that a
lot of code?

Thanks for your input!

Megan
Wayne Morgan
Guest
 
Posts: n/a
#2: Nov 12 '05

re: HELP: Conditional Formatting with VBA Code


The problem is that there is really only one control that is displayed
multiple times. To handle this problem, Conditional Formatting was
introduced in Access 2000. To get to this, open the form in design mode,
right click the control, and choose Conditional Formatting. If you are using
Access 97 or older, you may find some help from Stephen Lebans:

http://www.lebans.com/formatbycriteria.htm
http://www.lebans.com/alternatecolordetailsection.htm

--
Wayne Morgan
MS Access MVP


"Megan" <meganrobertson22@hotmail.com> wrote in message
news:5c14c12b.0405201305.6fcd9ff2@posting.google.c om...[color=blue]
> Can you write conditional VBA code that affects only one or two
> records on a continuous subform?
>
> I have a form with a subform on it. The parent/ child field that links
> the forms is CaseID. The main form has personal info on it. The
> subform deals with each case's Issues, Decisions, and Notices.
>
> Issues, Decisions, and Notices are all combo boxes. Not all Issues
> have Notices. Issues 25-50 have Notices. Issues 1-24 and 51-100 don't
> have Notices. I wrote a simple Case statement that makes the Notices
> combo boxes visible only when an Issue between 25 and 50 is selected.
> The VBA code works but has a drawback- the Notices combo boxes appear
> in all of my records on my continuous subform when one of my Issues is
> between 25 and 50.
>
> For example, case 7 has 3 Issues. Issue#1 = 1, Issue#2 = 75, Issue#3 =
> 25. After I select an Issue between 25 and 50 for one of my Issues
> combo boxes, the Notices combo boxes appear with each Issue, and I
> only want the Notices combo box to be visible with Issue#3.
>
> Is there a way to code it so that the Notices combo box only appears
> on those records where the Issue is between 25 and 50? Or is that a
> lot of code?
>
> Thanks for your input!
>
> Megan[/color]


Bradley
Guest
 
Posts: n/a
#3: Nov 13 '05

re: HELP: Conditional Formatting with VBA Code


Has anyone noticed anything different in Conditional Formatting in
A2003? I have some simple Conditions set up to change the colour of a
field that no longer works properly (worked fine in A2000)
--
regards,

Bradley


Wayne Morgan wrote:[color=blue]
> The problem is that there is really only one control that is displayed
> multiple times. To handle this problem, Conditional Formatting was
> introduced in Access 2000. To get to this, open the form in design
> mode, right click the control, and choose Conditional Formatting. If
> you are using Access 97 or older, you may find some help from Stephen
> Lebans:
>
> http://www.lebans.com/formatbycriteria.htm
> http://www.lebans.com/alternatecolordetailsection.htm
>
>
> "Megan" <meganrobertson22@hotmail.com> wrote in message
> news:5c14c12b.0405201305.6fcd9ff2@posting.google.c om...[color=green]
>> Can you write conditional VBA code that affects only one or two
>> records on a continuous subform?
>>
>> I have a form with a subform on it. The parent/ child field that
>> links the forms is CaseID. The main form has personal info on it. The
>> subform deals with each case's Issues, Decisions, and Notices.
>>
>> Issues, Decisions, and Notices are all combo boxes. Not all Issues
>> have Notices. Issues 25-50 have Notices. Issues 1-24 and 51-100 don't
>> have Notices. I wrote a simple Case statement that makes the Notices
>> combo boxes visible only when an Issue between 25 and 50 is selected.
>> The VBA code works but has a drawback- the Notices combo boxes appear
>> in all of my records on my continuous subform when one of my Issues
>> is between 25 and 50.
>>
>> For example, case 7 has 3 Issues. Issue#1 = 1, Issue#2 = 75, Issue#3
>> =
>> 25. After I select an Issue between 25 and 50 for one of my Issues
>> combo boxes, the Notices combo boxes appear with each Issue, and I
>> only want the Notices combo box to be visible with Issue#3.
>>
>> Is there a way to code it so that the Notices combo box only appears
>> on those records where the Issue is between 25 and 50? Or is that a
>> lot of code?
>>
>> Thanks for your input!
>>
>> Megan[/color][/color]

--
regards,

Bradley


Closed Thread


Similar Microsoft Access / VBA bytes