If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Conditional Formatting
Hey guys,
I have a field in the subform that I would to change color after validating the item number. I am already using conditional formatting, but the problem it only limits you to 3 conditional formatting. I need to have additional conditional formatting so a total of 4 conditional formatting. Field called "Item1", this item has 4 different format for example: 19204444 "MITM" Field Value is, equal to, MITM (Green) 19-204-444 "Item" Field Value is, equal to, Item (Green) P19204444 "PItem" Field Value is, equal to, PItem (Green) D19-204-444 "DItem Field Value is, equal to, DItem (Green) All the above items are the same number and I am validating those numbers, if it is the number is correct then color turn green and if it not correct it will turn red. Or, how could I combine all the four since I am validating against one number "Item" in one condition by using "expression is"? Please help me solve this issue Thank you |
#2
|
|||
|
|||
Conditional Formatting
Private Sub TextBoxNmae_AfterUpdate()
If Me.TextBoxNmae = "MITM" Then Me.TextBoxNmae.BackColor = vbGreen ElseIf Me.TextBoxNmae = "Item" Then Me.TextBoxNmae.BackColor = vbRed ElseIf Me.TextBoxNmae = "PItem" Then Me.TextBoxNmae.BackColor = vbGreen ElseIf Me.TextBoxNmae = "DItem" Then Me.TextBoxNmae.BackColor = vbRed Else Me.TextBoxNmae.BackColor = vbWhite End If End Sub -- Wayne Manchester, England. "Majic" wrote: Hey guys, I have a field in the subform that I would to change color after validating the item number. I am already using conditional formatting, but the problem it only limits you to 3 conditional formatting. I need to have additional conditional formatting so a total of 4 conditional formatting. Field called "Item1", this item has 4 different format for example: 19204444 "MITM" Field Value is, equal to, MITM (Green) 19-204-444 "Item" Field Value is, equal to, Item (Green) P19204444 "PItem" Field Value is, equal to, PItem (Green) D19-204-444 "DItem Field Value is, equal to, DItem (Green) All the above items are the same number and I am validating those numbers, if it is the number is correct then color turn green and if it not correct it will turn red. Or, how could I combine all the four since I am validating against one number "Item" in one condition by using "expression is"? Please help me solve this issue Thank you |
#3
|
|||
|
|||
Conditional Formatting
On Jun 20, 2:52*pm, Wayne-I-M
wrote: Private Sub TextBoxNmae_AfterUpdate() If Me.TextBoxNmae = "MITM" Then Me.TextBoxNmae.BackColor = vbGreen ElseIf Me.TextBoxNmae = "Item" Then Me.TextBoxNmae.BackColor = vbRed ElseIf Me.TextBoxNmae = "PItem" Then Me.TextBoxNmae.BackColor = vbGreen ElseIf Me.TextBoxNmae = "DItem" Then Me.TextBoxNmae.BackColor = vbRed Else Me.TextBoxNmae.BackColor = vbWhite End If End Sub -- Wayne Manchester, England. "Majic" wrote: Hey guys, I have a field in the subform that I would to change color after validating the item number. I am already using conditional formatting, but the problem it only limits you to 3 conditional formatting. I need to have additional conditional formatting so a total of 4 conditional formatting. Field called *"Item1", this item has 4 different format for example: 19204444 * *"MITM" * * * * * * Field Value is, equal to, MITM *(Green) 19-204-444 * "Item" * * * * * * *Field Value is, equal to, Item (Green) P19204444 * "PItem" * * * * * Field Value is, equal to, PItem *(Green) D19-204-444 *"DItem * * * * * *Field Value is, equal to, DItem (Green) All the above items are the same number and I am validating those numbers, if it is the number is correct then color turn green and if it not correct it will turn red. Or, how could I combine all the four since I am validating against one number "Item" in one condition by using "expression is"? Please help me solve this issue Thank you- Hide quoted text - - Show quoted text - Thank you but it did not work. It did not change color. I am going to keep trying and see why it is not working. Since the field name is Item1, here is what I did for just one in order to test it (that is for just PItem): Private Sub Item1_AfterUpdate() If Me.Item1 = "PItem" Then Me.PItem.BackColor = vbGreen Item1 = "" If IsNull(ScannedQty1) = True Then ScannedQty1 = 0 Me.AfterInsert = True ScannedQty1.SetFocus ScannedQty1 = ScannedQty1 + 1 Item1.SetFocus If ScannedQty1 = Qty Then Item1.SetFocus Item1 = PItem ScannedQty1.SetFocus SendKeys ("{tab}") End If End If End Sub Please let me know what I did wrong Thank you |
#4
|
|||
|
|||
Conditional Formatting
-- Wayne Manchester, England. "Majic" wrote: On Jun 20, 2:52 pm, Wayne-I-M wrote: Private Sub TextBoxNmae_AfterUpdate() If Me.TextBoxNmae = "MITM" Then Me.TextBoxNmae.BackColor = vbGreen ElseIf Me.TextBoxNmae = "Item" Then Me.TextBoxNmae.BackColor = vbRed ElseIf Me.TextBoxNmae = "PItem" Then Me.TextBoxNmae.BackColor = vbGreen ElseIf Me.TextBoxNmae = "DItem" Then Me.TextBoxNmae.BackColor = vbRed Else Me.TextBoxNmae.BackColor = vbWhite End If End Sub -- Wayne Manchester, England. "Majic" wrote: Hey guys, I have a field in the subform that I would to change color after validating the item number. I am already using conditional formatting, but the problem it only limits you to 3 conditional formatting. I need to have additional conditional formatting so a total of 4 conditional formatting. Field called "Item1", this item has 4 different format for example: 19204444 "MITM" Field Value is, equal to, MITM (Green) 19-204-444 "Item" Field Value is, equal to, Item (Green) P19204444 "PItem" Field Value is, equal to, PItem (Green) D19-204-444 "DItem Field Value is, equal to, DItem (Green) All the above items are the same number and I am validating those numbers, if it is the number is correct then color turn green and if it not correct it will turn red. Or, how could I combine all the four since I am validating against one number "Item" in one condition by using "expression is"? Please help me solve this issue Thank you- Hide quoted text - - Show quoted text - Thank you but it did not work. It did not change color. I am going to keep trying and see why it is not working. Since the field name is Item1, here is what I did for just one in order to test it (that is for just PItem): Private Sub Item1_AfterUpdate() If Me.Item1 = "PItem" Then Me.PItem.BackColor = vbGreen Item1 = "" If IsNull(ScannedQty1) = True Then ScannedQty1 = 0 Me.AfterInsert = True ScannedQty1.SetFocus ScannedQty1 = ScannedQty1 + 1 Item1.SetFocus If ScannedQty1 = Qty Then Item1.SetFocus Item1 = PItem ScannedQty1.SetFocus SendKeys ("{tab}") End If End If End Sub Please let me know what I did wrong Thank you You say that Field called "Item1", this item has 4 different format for example: "DItem "MITM" "Item" "PItem" All the above items are the same number and I am validating those numbers, It so what are these D19-204-444 19204444 19-204-444 P19204444 D19-204-444 Condidtional formating is simple if some is true then do this if it's not then either do nothing or do something else have a look at the code and gave and use it with some change to get it to format as you want. Sorry but I don't understand the "if it's true" section of what you are trying to do |
#5
|
|||
|
|||
Conditional Formatting
On Jun 20, 4:19*pm, Wayne-I-M
wrote: -- Wayne Manchester, England. "Majic" wrote: On Jun 20, 2:52 pm, Wayne-I-M wrote: Private Sub TextBoxNmae_AfterUpdate() If Me.TextBoxNmae = "MITM" Then Me.TextBoxNmae.BackColor = vbGreen ElseIf Me.TextBoxNmae = "Item" Then Me.TextBoxNmae.BackColor = vbRed ElseIf Me.TextBoxNmae = "PItem" Then Me.TextBoxNmae.BackColor = vbGreen ElseIf Me.TextBoxNmae = "DItem" Then Me.TextBoxNmae.BackColor = vbRed Else Me.TextBoxNmae.BackColor = vbWhite End If End Sub -- Wayne Manchester, England. "Majic" wrote: Hey guys, I have a field in the subform that I would to change color after validating the item number. I am already using conditional formatting, but the problem it only limits you to 3 conditional formatting. I need to have additional conditional formatting so a total of 4 conditional formatting. Field called *"Item1", this item has 4 different format for example: 19204444 * *"MITM" * * * * * * Field Value is, equal to, MITM *(Green) 19-204-444 * "Item" * * * * * * *Field Value is, equal to, Item (Green) P19204444 * "PItem" * * * * * Field Value is, equal to, PItem *(Green) D19-204-444 *"DItem * * * * * *Field Value is, equal to, DItem (Green) All the above items are the same number and I am validating those numbers, if it is the number is correct then color turn green and if it not correct it will turn red. Or, how could I combine all the four since I am validating against one number "Item" in one condition by using "expression is"? Please help me solve this issue Thank you- Hide quoted text - - Show quoted text - Thank you but it did not work. *It did not change color. *I am going to keep trying and see why it is not working. Since the field name is Item1, here is what I did for just one in order to test it (that is for just PItem): Private Sub Item1_AfterUpdate() * * If Me.Item1 = "PItem" Then * * Me.PItem.BackColor = vbGreen * * * * * *Item1 = "" * * * * * * If IsNull(ScannedQty1) = True Then ScannedQty1 = 0 * * * * * * Me.AfterInsert = True * * * * * * ScannedQty1.SetFocus * * * * * * ScannedQty1 = ScannedQty1 + 1 * * * * * * Item1.SetFocus * * * * * * If ScannedQty1 = Qty Then * * * * * * * * Item1.SetFocus * * * * * * * * Item1 = PItem * * * * * * * * ScannedQty1.SetFocus * * * * * * * * SendKeys ("{tab}") * * * * * * End If End If End Sub Please let me know what I did wrong Thank you You say that Field called *"Item1", this item has 4 different format for example: "DItem * * "MITM" * "Item" * "PItem" All the above items are the same number and I am validating those numbers, It so what are these D19-204-444 19204444 19-204-444 * P19204444 D19-204-444 Condidtional formating is simple if some is true then do this if it's not then either do nothing or do something else have a look at the code and gave and use it with some change to get it to format as you want. Sorry but I don't understand the "if it's true" section of what you are trying to do- Hide quoted text - - Show quoted text - Yes that is correct. Item 1 = 1934040000A = D19-34040-000A = P1934040000A = 19-34040-000A Because we are using different supplier and each have different formats. Thank you so much |
Thread Tools | |
Display Modes | |
|
|