?
Solved

Need Loop

Posted on 2006-03-27
2
Medium Priority
?
194 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


0
Comment
Question by:ca1358
2 Comments
 
LVL 8

Accepted Solution

by:
Leo Eikelman earned 2000 total points
ID: 16313858
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

0
 

Author Comment

by:ca1358
ID: 16315761
Tank you!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question