473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Continuous Forms Problem

283 100+
Hello,

I having some problems with a form where I have it set to Continuous Forms. I have a text box that I want to turn Red when a condition is met but when the condition is true it turns all of the text boxes red and not just the one on the current form I have focus on.

Is there any way to do with this VBA? I have created the condition in VBA just cant figure out the form part.

Appreciate any help!

Thanks
Slen

Working in Access 2007

Here is the code for the conditional expression
Expand|Select|Wrap|Line Numbers
  1. Dim objFrc As FormatCondition
  2.  
  3.  
  4. Me![txtBox].FormatConditions.Delete
  5.  
  6. Set objFrc = Me.Record_Number.FormatConditions.Add(acExpression, acEqual, Me.CheckBox.Value = True)
  7.  
  8. Select Case CheckBox.Value
  9. Case True
  10. With Me![txtBox].FormatConditions(0)
  11.                 .BackColor = vbRed
  12.             End With
  13.  
  14. End Select
  15.  
Dec 1 '11 #1

✓ answered by NeoPa

Please see Why Values in Unbound Form Controls do not Persist. If your control is bound, you may find Conditional Formatting worth checking out though.

5 1541
NeoPa
32,556 Expert Mod 16PB
Please see Why Values in Unbound Form Controls do not Persist. If your control is bound, you may find Conditional Formatting worth checking out though.
Dec 1 '11 #2
slenish
283 100+
Hi NeoPa,

Been a while..how have you been?

The form im currently using is a bound form unlike my usual MO of unbound. Im using continuous forms so I found using a bound form to be better suited for this.

Is there any way to use Conditional Formating with the bound form and keep the focus on the current form? If I set the condition of a text box by using the user friendly way and just clicking on the conditions button and then set the condition. But im trying to do it with VBA. Any ideas?

Thanks :D
Dec 1 '11 #3
NeoPa
32,556 Expert Mod 16PB
Hi Slenish. I'm good thanks. You too I hope.

The fundamental point is that there is only the one control, no matter how many instances of this you see on the form. I think that means that any VBA code would be pointless. You can only configure the control one way. What would be the point of changing it while it's running. Any definition could more easily be done at design time.
Dec 1 '11 #4
slenish
283 100+
Hi NeoPa. Im doing good as well.

Guess if i cant do it with VBA thats alright I can always do it the other way with the conditions button. Just thought I would challenge myself :D

Appreciate the help my friend.
Dec 1 '11 #5
NeoPa
32,556 Expert Mod 16PB
Always welcome :-)

NB. It's not exactly that VBA cannot set the control up to do the conditional formatting, it's more that there would be no point when you can include it in the design (as there is no point during the running of the code where it would be appropriate to change the configuration).
Dec 1 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Cro | last post by:
Dear Access Developers, I am developing a form with 'default view' set to "continuous forms". I am suffering with a problem I can't yet see a solution too. Each record has many fields. Two...
5
by: Armando | last post by:
I recently saw the tail end of a "Continuous forms" discussion, but not enough was available to see if this will be a PITA repeat question. Sorry if it is. On a form with its Default View...
6
by: Rose | last post by:
I have set my form's default view property to continuous forms and have added a field for the table columns I wish to view. What do I need to do to allow more than one record to show at the same...
3
by: Richard Hollenbeck | last post by:
I have the following query in my form's code: Private Function Get_Data(fieldNum As Integer) Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset strSQL = "SELECT & "", "" & ...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
1
by: blueheelers | last post by:
I have been researching for several hours on the best way to display images in continous forms in Access 2003. For example, I want to display employee name, email, phone, and picture for each...
1
by: rpboll | last post by:
I am looking for the best way to accomplish the following continuous forms concept. There are Five Groups: A, B, C, D, E Each group has eight Members: a, b, c, d, e, f, g, h Each...
5
by: bittman | last post by:
I have code as follows: Dim conn As New ADODB.Connection Dim rst As New ADODB.Recordset conn.ConnectionString = "Provider=MSDAORA;Password=tr7025ds;User ID=system;Data Source=WIN10" conn.Open...
5
by: kenethlevine | last post by:
Hello I am fairly new to Access and am having a problem for which I am trying everything without success. It is access 2003. I have a main form. When the user presses a button a modal popup...
5
by: grahamib | last post by:
I have a form running in access 2003. The forms property is set to continuous forms so that all records from an underlying query can be diaplayed. On the form are 12 sets of fields from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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...

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.