Results 1 to 5 of 5
  1. #1
    haditirip is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Oct 2013
    Posts
    2

    Black list for a subform!

    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...

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    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.

  3. #3
    haditirip is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Oct 2013
    Posts
    2
    Yes.It`s a table and for example thera are some phone numbers for blacklist
    And subform is in Continuous

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    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.

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    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:

    1. Right Click on the Textbox to select it
    2. Click on Conditional Formatting
    3. Use the Condition1 dropdown to select Expression Is
    4. In the box to the right type: DCount("*", "BlackListTable","PhoneNumber = '" & [PhoneNumber] & '"') > 0
    5. You'll see B(old) I(talics) U(nderline) Paint Bucket (BackColor) A Big A ForeColor Enabled
    6. Click on ForeColor or BackColor (whichever you want) and set the color as desired
    7. 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

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-19-2013, 11:43 AM
  2. Replies: 5
    Last Post: 07-10-2013, 11:39 AM
  3. Replies: 1
    Last Post: 03-29-2012, 12:20 AM
  4. Report printing black boxes
    By stephenaa5 in forum Reports
    Replies: 1
    Last Post: 05-11-2011, 04:53 PM
  5. Replies: 1
    Last Post: 07-30-2009, 12:54 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums