Hello every body!
I want to create a black list for a subform
For example,when I enter a number to the subform,if the number be in blacklist,it become red color!
Please help me fast!!
thanks...
Hello every body!
I want to create a black list for a subform
For example,when I enter a number to the subform,if the number be in blacklist,it become red color!
Please help me fast!!
thanks...
What do you mean by 'in blacklist'? You have a table called 'Blacklist'?
Is the subform in Continuous or Datasheet view? Use textbox Conditional Formatting.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes.It`s a table and for example thera are some phone numbers for blacklist
And subform is in Continuous
Need to understand data structure and form design. What table do the numbers you select come from? Why is there a separate table for 'blacklist' numbers? Why would 'blacklist' numbers even be available for selection?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
To us Conditional Formatting, as you have to for this kind of Form, as Paul said, in Form Design View of the Form the Subform is based on:
- Right Click on the Textbox to select it
- Click on Conditional Formatting
- Use the Condition1 dropdown to select Expression Is
- In the box to the right type: DCount("*", "BlackListTable","PhoneNumber = '" & [PhoneNumber] & '"') > 0
- You'll see B(old) I(talics) U(nderline) Paint Bucket (BackColor) A Big A ForeColor Enabled
- Click on ForeColor or BackColor (whichever you want) and set the color as desired
- Click on OK
This assumes that the phone number field is defined as Text. Even if a Field contains digits only, I define it as Text, not as a Number. I only use a Number Field if there's going to be math involved, but that's just a personal choice. If your Field is defined as a Number the DCount syntax would be
DCount("*", "BlackListTable","PhoneNumber = " & [PhoneNumber]) > 0
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007