473,480 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HELP: Conditional Formatting with VBA Code

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
Nov 12 '05 #1
2 5818
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" <me**************@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
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

Nov 12 '05 #2
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:
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" <me**************@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
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


--
regards,

Bradley
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6859
by: brAccess | last post by:
I recently installed Access 2003 and immediately noticed problems with applications that work fine in 2000 and XP. I use conditional formatting on continuous forms for a number of reasons. When...
4
3112
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
8
12005
by: Dimitri Furman | last post by:
Given: Access 2002/2003 A subform in datasheet or continuous view, placed on a tab page (this last may or may not matter) Conditional formatting applied to some controls on the subform - format...
2
2942
by: Von Bailey | last post by:
I have a form where the conditional formatting is set on some fields to bold if certain conditions are met. However, when the conditions are met some of the data that is to bold is either not...
5
8941
by: Andrew Chanter | last post by:
Does anyone know a way you can use conditional formatting to create a banded style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd...
1
4941
by: GGerard | last post by:
Hello Is there a way to use a variable in the Conditional Formatting of a Textbox? Example : I want the background of a textbox in a continuous form to change color when the value of...
2
2331
by: jodyblau | last post by:
I'm not certain that what I am trying to do is possible; in any event I haven't been able to figure it out. Here is what I am trying to do: I have one table that has a list of cases I'm working...
8
8454
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works...
4
13096
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
2
3099
by: Filips Benoit | last post by:
Dear All, Access 2003 adp on SQL_server 2005 A continious form showing 1 month based on table 'CALENDAR_MONTH_GRID' and fill with a SP. Fields: Companyname, Day1, day2, etc. The value in the...
0
7044
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7045
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7087
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.