We help IT Professionals succeed at work.

Need Loop

ca1358
ca1358 asked
on
Medium Priority
209 Views
Last Modified: 2010-04-07
I have this code below, everything works except this (1)piece.  I need to make a loop that goes through and each record with that Company Number match the Company Number(Text38) then make all chech boxes blank and  [Desicioned by Mandatory] = " " blank.  

Any help would be appreciated.
////////////////////////////////////////////////////////
(1)

ElseIf IsNull(Combo91) Then
 
 If [Company Number] = Me.[Text38] Then

    [Positive Mark] = False
    [No prior maintinance] = False
    [Strong ATE] = False
    [Nominal/reasonable MTM exposure] = False
    [Good fill rate] = False
    [Low request amount] = False
    [Desicioned by Mandatory] = " "
 
///////////////////////////////////////////////////////////

All the code below
/////////////////////////////

Private Sub Combo91_Click()
Dim sql As String
 Me!loginnumber = fOSUserName
 
 If [Company Number] = Me.[Text38] Then
     Me!loginnumber = fOSUserName
   
   
    If loginnumber = "N574824" Then
       Man = "Carol Armstrong"
   ElseIf loginnumber = "M006620" Then
     Man = "Tracy Wood"
   ElseIf loginnumber = "M001542" Then
Man = "John Carrigan"
   ElseIf loginnumber = "M004551" Then
   Man = "Steve Keldermans"
  ' ElseIf LoginNumber = " " Then
      'Man = "Brian Kizer"
   
   Else
       Man = fOSUserName
    End If
 
'////////////////////////////////////////

   Me.Dirty = False
 
If Not IsNull([Combo91]) Then
 sql = "update [Roll Exception Report] set [Denied/Approved Mandatory] =""" & Me.[Combo91] & """ where [company number] = " & Me.[Text38]
 CurrentDb.Execute sql, dbFailOnError
     
 sql = "update [Roll Exception Report] set [Desicioned by Mandatory] =""" & Me.Man & """ where  [company number] = " & Me.[Text38]
 CurrentDb.Execute sql, dbFailOnError
     
 ElseIf IsNull(Combo91) Then
 
 If [Company Number] = Me.[Text38] Then

    [Positive Mark] = False
    [No prior maintinance] = False
    [Strong ATE] = False
    [Nominal/reasonable MTM exposure] = False
    [Good fill rate] = False
    [Low request amount] = False
    [Desicioned by Mandatory] = " "
 
Me.Refresh
Else
End If
End If
End If


Comment
Watch Question

Director, IT and Business Development
Commented:
if all u want to do is clear checboxes then you can do this

 Dim fSelectedField As FormField
  Set fFields = ActiveDocument.FormFields
 
  ' Clear all existing checks
  fFields("Positive Mark").CheckBox.Value = False
fFields("No prior maintinance").CheckBox.Value = False
etc........



Cheers,

Leo

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Tank you!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.