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:
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?
What I am trying to do is create conditional formatting to colour fields within a form.
The conditional formatting option built in allows me to colour based on set values i.e. Value=Design turns green. I need to somehow say if Value contains the word Design turn green. This is because in addition to the word Design there will be a variable description. I tried editing the conditional format created by the wizard to Value="*Design*" but that didn't work.
Now I'm trying to write it in VBA code but am still struggling. Here's what I tried but it doesn't like it:
If InStr([Forms]![Query2]![Activity] Like "*Design")>0 Then [Forms]![Query2]![Activity].BackColor = vbGreen End If
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.
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.
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.
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?
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.
New to Access. We have a existing database in use that has a minor glitch. The main form we use to add records to has a subform. All of the data in the main form shows up when printed to a pdf file. The header section & detail section of the subform prints to the pdf file but the footer section remains blank in the pdf file.
I am exporting data from access 2007 to Excel 2007 using VBA code. I have a whole number, which I want displayed as whole number. But after the export, the number is using the 1000's seperator in Excel. So for example if my original number in access table is 12000, it is showing up as 12,000 in the excel file.It has something to do with the NumberFormat property. I have tried doing this but doesn't work.
I have text boxes that combine two fields into one, for example the control source is =IIf(IsNull([BuckC])=True And IsNull([BoostC])=True,"",[BuckC] & " , " & [BoostC]) . For simple its just =[Buckc] + ": "+[BoostC]. I am trying to set a condition that if one of them exceeds a certain number the background color will change to yellow. I know how to do this if its only for one field but I am wondering if it is possible to do it with multiple fields?
Hi all, sorry to bother you all, especially if this has already been answered, but I can't seem to find the solution to it. Assuming that what I've been doing has been correct that is.
I have three (3) tables with the following fields (where PK is primary key); [tbl Ingred]: IngredID (PK), ProdID_fk, CompCode, IngredName, Weight, Symbol, RP01, RP02, RP03, RP04, RP05, RP06, RP07, RP08, RP09, RP10 [tbl Prod]: ProdID (PK), ProdName, FP, BP, SBU, ProdNotes [tbl RPCalc]: RPs, RPs_long (PK), Sym, Limit, Sym_1, RP_1, Comp_1, Add, RP_01, RPNotes
[tbl Prod] has a one-to-many relationship with [tbl Ingred]; that is, for one ProdID, there can be many IngredIDs. The tables are designed so that the final user-displayed form is 'user-friendly'.
I've made a qry called [qry Qcalc] used to calculate the the Quotation (Q) of each of the 10 RPs (RP01 - RP10). Which simply for the first one is; QRP01: [Weight]/[tbl RPCalc_1].Limit, where the [tbl Ingred].[RP01] is linked to a corresponding [tbl RPCalc], by the [RPs] field. As for one [RPs] there may be multiple [RPs_long]. The way it is set up is so that the [RPs] and [RPs_long] are mapped correctly, to be used for calculations.
However, I am now stuck with a problem. I need to sum up these QRP values ([QRP01] - [QRP10]), based on (at least?) two conditions. The user can enter in their RPs; e.g. R10, R20, R21 in any of the [RP01] to [RP10]'s, and in any order.
What I need is to be able to obtain a sum of the Q values for each [RPs_long] (e.g. R10, R20, R21), rather than being the sum of the fields [RP01] to [RP10]. Also, each [RPs_long] may or may not be able to be summed up, depending on another field [Add] which has a "Yes" or "No". "Yes" is for it being able to be summed up, and "No" for it not being additive.
So the end result would be; for each [ProdID], there will be multiple [IngredID] where each will have up to ten (10) "RPs" (that being the [RP01] to [RP10] fields). These inputted "RPs" are then related to [tbl RPCalc] to be able to obtain the Q-values. If the Q-Value is not greater or equal to 1 (>= 1), then the sum of the Q-values for each [RPs_long], provided that the [Add] field is "Yes", will then be able to determine what are the final output RPs to be used, i.e. for the sum of the Q-values are greater or equal to 1 (>= 1), that [RPs_long] will be used.
I've been stuck on this for quite some time, and I know that if I change the whole table structure (like having a field for each RPs in the [tbl Ingred]), I might be able to make it much easier for myself. However, by doing so, it will not be able to offer as much flexibility in the calculations, and also, may not make it as 'user-friendly'. Another thought was maybe to create another table with just the [CompCodeID] (based on [tbl Ingred].[CompCode]), [Weight], [RP], but I'm not too sure how this will work either, but I might give it a shot if this current method doesn't work.
I hope that this made sense, as it is all quite complex (and confusing) to me. Any help on this matter will be much appreciated. Thanks in advance.
Basically I have a form which records primary and secondary reasons for people writing off money, and in the secondary reasons I have an option for 'other', in case any of the other options aren't applicable. There is also a comments section on the form which is optional.
My issue is, I want the comments section to become mandatory if the 'other' option has been selected. I don't want it mandatory all the time, and I don't want it disabled if 'other' isn't selected, but I need to force people to write at least something in there if they have selected other.
I tried variations on code I found from other places but was unable to get this to function, and I am not sure if this can be done with validation or something like that.
I have a field on a report that I was able to make bold using conditional formatting. I want to make the other fields in the row bold as well if the value of the 1st field equals a set value.
I put conditional formatting on the Contractor field
EX: Field Value Is equal to "Estimations"
I was Bid Amount, Sq Footage, =[bid amount]/[sq footage] and =[bid amount]/[estimate] fields to also be bold if the Contractor field is equal to Estimations.
Have a continuous form with 2 date fields in each record .
If dateField1 is empty ,Then I want a way to make DateField2 Take its Place .
I know how to make things happen with conditional formatting on one field by UsingIsNull ,I have tried sending datefield2 to back.But cant work out how to bring it to front If DateField1 IsNull.
I have an interesting report query I am working on. Is it possible to have a query that shows different fields for individual records depending on the content of the record? Let me see if I can explain. Let's say that I have a Status field that can be "Complete", "Active", or "Planned". And lets say also in that table I have Field1, Field2, and Field3. For each record, I don't want to include all three fields (Field1, Field2, Field3), but only one of these fields depending on what is in the Status field.
So, it would be something like:
Select Status, (if Status = "Complete", select Field1), (if Status = "Planned", select Field2), (if Status = "Active", select field3) FROM table;
So, the query would result in 2 fields for each record: the status field, and one of the three other fields depending on what is in the status field for that record.
In my Access 2010 report, I am attempting to perform conditional formatting of one field based on the difference between two fields. In particular, one field is "Time Scheduled" and the other field is "Time In". If the "Time In" is equal to or greater than 60 minutes of "Time Scheduled", I would like to format it to be red font. If it is less, I would like to format it to be green font.how I can conditionally format to do this?