Results 1 to 3 of 3

Thread: Spot the error in this code .....

  1. #1

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818

    Spot the error in this code .....

    Can anyone tell me what, in the following code, I would need to change to make it work when I convert it to an ActiveX form ?

    VB Code:
    1. Private Sub Check_Fields()
    2.    
    3.     For Each Ctrl In frmMain
    4.         If TypeOf Ctrl Is TextBox Or TypeOf Ctrl Is ComboBox Then
    5.             If Ctrl = "" And Ctrl.Visible Then
    6.                 FieldsOK = False
    7.                 MsgBox "You cannot have any blank fields !", vbOKOnly, "Empty Field"
    8.                 Ctrl.BackColor = vbWhite
    9.                 Ctrl.SetFocus
    10.                 Exit Sub
    11.             End If
    12.         End If
    13.     Next Ctrl
    14.    
    15.    
    16. End Sub


    Thanks a lot ....

  2. #2
    Fanatic Member Bonker Gudd's Avatar
    Join Date
    Mar 2000
    Location
    Saturn
    Posts
    748
    VB Code:
    1. For Each Ctrl In [b]frmMain.Controls[/b]
    2.         If TypeOf Ctrl Is TextBox Or TypeOf Ctrl Is ComboBox Then
    3.             If Ctrl = "" And Ctrl.Visible Then
    4.                 FieldsOK = False
    5.                 MsgBox "You cannot have any blank fields !", vbOKOnly, "Empty Field"
    6.                 Ctrl.BackColor = vbWhite
    7.                 Ctrl.SetFocus
    8.                 Exit Sub
    9.             End If
    10.         End If
    11.     Next Ctrl

  3. #3

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818
    Nope ... that didn't work.

    The code does work before you convert the form, but I guess IE5 can't interpret it when its an ActiveX !

    Any other ideas ?

Posting Permissions

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



Click Here to Expand Forum to Full Width