Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can't remember the code to format the color of each textbox in the detail section of a report. Could some please help, it was something like.

    For each ctrl in details
    if me.ctrl.value = 0 then
    do stuff here
    end if
    next

    Thanks for the help

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Here is an example:

    Code:
      Dim ctl As Control
      For Each ctl In Me.Details.Controls
    	If ctl.ControlType = acTextBox Then
    	  If ctl.Value = 0 Then
    		ctl.BackColor = vbRed
    	  End If
    	End If
      Next ctl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •