Conditional Format Form Based On Text In Txtfield

Sep 14, 2006

Hi All,

I'd lile to show/hide selected subforms based on the the text in a txtfield.
The text in the selection field (txtSelect) I'd like to use for that may be either one of the following:

book-01, book-02, book-03 etc OR,
folder-01, folder-02, folder-03 etc OR,
record-01, record-02 record-03 etc. OR
it can be just a 4 digit number.

If the txtSelect contains "book" I'd like the subfrmBookdetails to be visible.
If the txtSelect contains "folder" obviously the subfrmFolderdetails etc.

What I'm struggling with is the If-Then statement for selecting the partial text in txtselect.

I've tried things like this:
On current
me.txtSelect.setfocus
if me.txtSelect.text="book*" then
me.subfrmBookdetails.visible=true etc etc.

No joy.

I know how to get this to work in a query with a like-statement but I have not been able to find anything on this in relation to conditional formatting of a form. Any one and good ideas?

Thanks,
Walter

View Replies


ADVERTISEMENT

Conditional Formatting - Form Based On Text Box Entry

Mar 24, 2006

Hello,
Could some kind person out there help me out please?
I have been 'dabbling in' the area of conditional formatting, particularly in the area of changing the colour of my active form based on the result of what’s output on a text box. I have had some success in this area but where I am getting confused is getting the colour of my form to change on the basis of what is entered into a text box control that does not match exactly. My forms background changes to the required colour when its value is ‘set exactly’ but what I am trying to achieve is to change it according to the first letter of entry regardless of what follows? It always starts with a letter, either a ‘D’ or ‘V’ to indicate whether its ‘Vital’ or ‘Desirable’ and is subsequently followed by no more than 6 numbers and finally a letter. Basically I need my form to change colour based on the whether it is either a ‘V’ or a ‘D’ irrespective of what follows???

What I have been using so far is:

Private Sub Model_Number_AfterUpdate()
If Me.Part_Number = "V111145K" Then
Me.Section(acDetail).BackColor = 12632256 'Light Red
Else
Me.Section(acDetail).BackColor = 8421631 'Blah Gray
End If
End Sub


Private Sub Form_Current()
If Me.Part_Number = "V111145K" Then
Me.Section(acDetail).BackColor = 12632256 'Light Red
Else
Me.Section(acDetail).BackColor = 8421631 'Blah Gray
End If
End Sub

Can anyone help me out of a ' sticky situation'..

Ta Very much

Carol

View 3 Replies View Related

Conditional Format Based On 2 Fields

Jan 24, 2008

Hello All,

I have searched the forum but I don't quite get what I am looking for.
I have a subform that has these 2 fields:
- Status
- LastFollowup

What I want is if the Status shows "Pending" and the date entered on the LastFollowup is more than 7 days. Then it should turn Yellow.

I tried this code in the expression box but it doesn't seem to work

[Status]="Pending" and [LastFollowup]>7


Could anyone please assist? I know this is simple but it's not working for me.

Thank you

View 6 Replies View Related

Conditional Format Based On Previous And Current Record

Feb 4, 2005

I'm having trouble with a tricky conditional format in a continuous subform.

The criteria is based on field [GroupNo] when it changes (increases) which are always listed in numerical order.

Basically all I want to is for the text box colour to alterante (eg blue & yellow)when GroupNo changes value

So it would look something like this....

Group NoID (highlight colour)

1 (yellow)
1 (yellow)
1 (yellow)
2 (blue)
2 (blue)
2 (blue)
3 (yellow)
3 (yellow)
etc etc

btw, although values will always be in order they may not all be output, so it's not just case of odd, even, odd, even (that would be too easy!)

I can retrieve the Previous Record's GroupNo value (via a function) in another text box and compare current GroupNoID with this in the Format Expressions and manage to change the colour, but it won't sustain this new colour for the subsequent same GroupNos, obviously as the values have changed.

So how can I....

Change the colour when the value changes.
Keep this new colour until it the value changes (increases) again.

Many Thanks

View 14 Replies View Related

Forms :: Format Text Boxes On Continuous Form Based On System Date

Aug 14, 2014

I have a continuous form (2003) with 6 text boxes (StartTime, StopTime, Comments etc...). I would like all the text boxes to have a gray background if the StartTime for that row is less than Today().

View 5 Replies View Related

Conditional Format - Form Background

Mar 24, 2006

Could some kind person out there help me out please?
I have been 'dabbling in' the area of "conditional formatting", particularly in the area of changing the colour of my active form based on the result of whats input on a text box. I have had some success in this area but where I am getting confused is getting the colour of my form to change on the basis of what is entered into a text box control that does not match exactly. My form background changes to the required colour when its value is 'set exactly' or matches, but what I am trying to achieve is to change it according to the first letter of entry regardless of what follows thereafter? It always starts with a letter, either a ‘D’ or ‘V’ to indicate whether its ‘Vital’ or ‘Desirable’ and is subsequently followed by no more than 6 numbers and finally a letter. Basically I need my form to change colour based on the whether it is either a ‘V’ or a ‘D’ irrespective of what follows???

What I have been using so far is:

Private Sub Model_Number_AfterUpdate()
If Me.Part_Number = "V111145K" Then
Me.Section(acDetail).BackColor = 12632256 'Light Red
Else
Me.Section(acDetail).BackColor = 8421631 'Blah Gray
End If
End Sub

.................................................. .................................................

Private Sub Form_Current()
If Me.Part_Number = "V111145K" Then
Me.Section(acDetail).BackColor = 12632256 'Light Red
Else
Me.Section(acDetail).BackColor = 8421631 'Blah Gray
End If
End Sub


Your help would be gratefully appreciated:confused:

Thanks Very Much


Carol

View 1 Replies View Related

Forms :: Conditional Formatting Text Boxes Based On Yes / No Field

Jan 8, 2015

I am trying to get the text in a couple text boxes to turn green if a certain Yes/No field is left blank.

I know the conditional formatting is working, because condition 1 and 3 are working fine (those expressions are referencing text fields).

I would like to have Condition 2 look at [DM_Approval] from the bound query and if it is unchecked, execute the conditional formatting.

I've tried all kinds of statements, but i'm starting to think that the expressions in the conditional formatting window just won't work when referencing a yes/no field.

Specifically (at the very least) i know i tried [DM_Approval]=False, [DM_Approval]=No, [DM_Approval]=0, and [DM_Approval] is null.

View 3 Replies View Related

General :: Fields On Form - IF Then Conditional Format

Jan 14, 2014

I have a field on a form OrderDate and a field DOB. I am not sure how to create an expression in conditional formatting that:

=IF([DOB] - [OrderDate] <30), Then background is red

So if the OrderDate is 1/1/2014 and the DOB is 1/15/2014 then the DOB field turns red

If the OrderDate is 1/1/2014 and the DOB is 2/29/2012 then the DOB field does not turn red.

View 8 Replies View Related

Conditional Formatting Format

Apr 18, 2006

Hi,

I am trying to place some code in the "expression is" section of conditional formatting. Need some help converting from code to conditional formatting format.

I have set up a check box "Check83" next to a standard control box "Title(O)".
Below is the code I am currently using. This code is in the after update section of the check box, and in the oncurrent section of the form.

This code turns the box blue when I click the check box.

Private Sub Check83_AfterUpdate()
If Me.Check83 Then
Me.[Title(O)].BackColor = vbBlue
Else
Me.[Title(O)].BackColor = vbWhite
End If
End Sub

My form has 46 records and all have check boxes linked to the control box with the code above. When the box is blue in record 1, I don't want there to be a blue box in record 2. Can't figure out how to do this. Tried to do in with code, but failed. Thought it may be possible using conditional formatting.

Thanks in advance for your help

Jcwishart

View 3 Replies View Related

Conditional Format Hyperlinks

Feb 23, 2005

Because they are more efficient, I am using hyperlinks to connect my forms. I want to be able to deactivate hyperlinks based on criteria that are selected.

Please help! :o

View 3 Replies View Related

Reports :: More Than 3 Conditional Format

Dec 2, 2013

I have a report with a list of employee names (and other information). A handful of them need to be a different color (other than default). There will always be more than 3, so I can't use the conditional formatting tool.

View 14 Replies View Related

Conditional Format A Comman Button?

Dec 7, 2005

Quick question.

I have a continuous form in Access 2003 listing products for return for a customers. I am in the process of creating a completion form which will just have the product number, model number and then a command button called complete.

What I'm doing is have it so when the person clicks the button it adds a value to a field saying Complete. OK. But, what I then want it to do is for any record thats associated with this customer where the field = complete to have the command button gray out.

Is this possible? I know I can conditional format a text box to do this but can't see a way to do it with a command button? Any ideas?

I have though of layering a transparent button and having a textbox behind this with complete in and having this change colour but not sure if thats the best way?

View 1 Replies View Related

Forms :: Assign Field With Special Format Based On Date / Time Format

Feb 17, 2014

I wanted to assign the field "Number of magazine" with special format based on date/time format but showing only year and month in the format: "yyyy-mm".

So in property of this field in format I put yyyy-mm and in input mask I type 0000-00;;-

I also created the form based on the table containing above field and I defined format and input mask for corresponding formant in the same way like at the table.

But if I try to type date for example 2014-01 in text box of the form it comes up with the full date 2014-01-01. Why does it do like this? What do I do incorrectly?

View 2 Replies View Related

Conditional Format All Fields In ACTIVE Record

Feb 1, 2005

:D I am using a continuous form, and I cannot figure out what conditional formatting expression to use to change controls in the ACTIVE RECORD.

For example, continuous form may have:

RECORD1: Field 1 Field 2 Field 3 Field 4
RECORD2: Field 1 Field 2 Field 3 Field 4
RECORD3: Field 1 Field 2 Field 3 Field 4

When I am in Field 1,2,3, or 4 in RECORD2, I want Fields 1,2,3 AND 4 to change color in RECORD2

PLEASE HELP!

View 5 Replies View Related

Modules & VBA :: Conditional Format Excel Export?

Dec 11, 2013

I'm exporting a query to Excel, and I want to be able to conditionally format certain rows of the export using Access VBA. Is this possible?

View 1 Replies View Related

Show Text Box In A Form Based On Character Within A String In Another Text Box

Dec 21, 2012

I have a form where I want a textbox [txtMaxOrdLimit] to be visible only if another text box on the same form [PaNumber] contains the letter D in the string. This is the code I have on the forms On Current property but I'm missing something because textbox [txtMaxOrdLimit] doesn't show on the form at all.

If Me.PaNumber = "*D" Then
Me.txtMaxOrdLimit.Visible = True
Else
Me.txtMaxOrdLimit.Visible = False
End If

View 3 Replies View Related

General :: Set Up Conditional Format To Highlight Any Dates Within January Red

Jun 17, 2015

I have a report and i'm trying to set up the conditional format to highlight any dates within January red.

View 1 Replies View Related

Reports :: Conditional Format Date Field For Current Month

May 20, 2014

I have a short date field 5/20/2014

I would like to set up a conditional format to format those fields in the current month. For example, this month is would format all fields with "5".

Next month all fields with "6"

In the month space.

I can't seem to figure out the expression, I know I'm close.

View 4 Replies View Related

Modules & VBA :: Use Text Box Change Event To Determine Form Format

Sep 23, 2013

Had a combobox so the user could choose between two data entry formats.They don't want the combobox, they want the user to enter data into one or the other textbox - and that choice to trigger the format.Two groups of text box - group 1 has a single text box - group 2 has three text box. When the user selects a text box and types the first character into it. This triggers locking out the other group choice and enables the <Validate and Edit> command button.

If the user backs out (deletes) the text in a text box.It basically makes both groups available again and it disables the <Validate and Edit> command button.Basically, if the text box Change event counts a character, it changes the text box Tag to "Bust". Then it calls a common routine that checks both text boxes.The choice won't take place if the textbox gets focus. It changes if a text box has 1 or more character typed in.

Code:
Sub WhosOnFirst()
' two groups of Required field - if one textbox in a group has a character entered first
' that group becomes the Format - enables the <Validate and Accept> button that will take the next setp

[code]...

View 2 Replies View Related

General :: How To Format The Text Using Format Function

Jul 7, 2015

I want to format the text using format function. how i format the word apple to "apple" (With Quatation mark).

str = Format(Me.word, xxxx)

View 3 Replies View Related

Conditional Formatting Based On DCount

Apr 11, 2006

Hi all.

I've been struggling to find a solution for this. Never previously used conditional formatting I could use some help.

I have a sub form consisting of continuous forms...

Based on whether or not the below DCount indicates 1 or 0 I want to change the BackColor of a Textbox.

DCount("fID", "tblRegister", "fID = " & Me.fID.Value & " AND samtyckeBarn = TRUE AND samtyckeBarnVuxen = TRUE"))

Where/how do I implement this?
I do not yet fully understand the FormatConditions collection of the textbox but I guess that's where to work.

View 2 Replies View Related

Conditional Formatting Based On Another Field

Mar 28, 2006

Is there a way to apply conditional formatting on a field based on the contents of another field?

For example, lets say I have the following fields

START_DATE
APPROVED_DATE
CAT#
DAYS_OPEN

The DAYS_OPEN field is automatically calculated in the query and is not a stored date.

My criteria is that if CAT# is 3, my days open should not exceed 30 but if my CAT# is 1 or 2, my days open should not exceed 60. I want to apply conditional formatting so that it turns yellow at approximately 80% of the date limit and red at approximately 90% of the date limit, otherwise the conditional formatting is green.

I know how to do conditional formatting, but no sure if it can be modified based on the content of another field.

Thanks for any suggestions.

Jim

View 4 Replies View Related

Conditional Visibility - Based On Subforms

Feb 28, 2014

I have a main form with several subforms within it. These subforms are navigation tabs. In the footer of the main form I have a textbox that I want to hide unless the 2nd tab is selected.

Details:

3 Tabs, 1 subnavigation subform, 3 tab indexes(0,1,2)
tab index 1 the textbox on the main form(parent) should be visible. tab index 0 and 2 the textbox should be hidden.

I was thinking I could do something like when tab index 1 is onFocus then textbox = visible and vice versa on the other tab indexes?

View 14 Replies View Related

Forms :: Open Blank Form Based On Value In Text Field In Main Form

Jun 6, 2013

I have one table containing name of restaurant with its address etc. Then i created another table to list out the restaurant workers names and details. Just as an example,

Table:Restaurant
Restaurant name
Address line 1
Address line 2
Restaurant #
Website

Table:StaffContact
Staff Role
Name
speciality
email
phone

I have the main form that has all the restaurant details only. And i have another form containing the Staff information. Please note the two table have a relation and it works well.

Now to make it user friendly(basically easier for the lazy ones), I dragged the staff contact form on to my main form and displayed it as a datasheet(basically a sub form).

Now, my boss does not want users to add/delete on this sub form(datasheet). So,he wants me to create buttons to open new record of staff for each restaurant(new form)

My issue is with opening a new record to enter a new person to the staff list and give them a role as well in form view.The new form has

So i ran a Macro, with open form with Where condition

Code:
[Staffcontact]![Rest Name]=[Forms]![MainForm]![RestaurantName]

But, it does not work .

View 2 Replies View Related

New At Access: Update Simlar Text Fields In One Form Based On Another Form

Jun 13, 2006

I am very new at Microsoft Access. I have two forms, A and B, that are filled out by two different users. Form A gets filled out first than form B gets filled out. Each has a name box as well as a birthdate box and a few other similar text fields. However, each form also has a few distinctive fields. I was wondering how I could input the common information in Form A to Form B so the user of Form B does not have to spend time retyping the name and birthdates again. In other words, I want to synchronize the similar records between the two forms. I would like the values to appear in a table as well. I would greatly appreciate it if someone could help me with the visual basic code. Thank You.

View 1 Replies View Related

Conditional Visability Based On Combo Box Selection

Dec 22, 2006

I'm not new to object oriented programming but I am new to Access. I have found some questions similar to mine in search but I need more explanation if someone wouldn't mind.

In my form, I have a combo box that looks up 3 values from another table. Among other controls, I have a few text boxes that I only want visible if 1 of the 3 possible combo box options are selected.

I understand that the code for this should probably be placed in the "events" of the of the combo box...which one? I understand the logic but what would the code look like? Do I use the expression builder?

Thanks for any help on this.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved