Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2006
    Posts
    2

    Unanswered: 424 Object required (ROTATING IMAGE ON SUBFORM)

    Hi,

    Form with SubForm

    I want to load a linked picture to the subform by the onTimer event.
    The pictures source is as follows

    Dim txtLngPIC as long
    on Error GoTo errHandler:
    Select case txtLngPOC
    Case 1
    Me.Child1.Form!img1.Picture = Nz (Me.Child1.Form!FName1)
    txtLngPIC = txtLngPIC +1
    me.txtLngPIC = txtLngPIC
    Case 2
    Me.Child1.Form!img1.Picture = Nz (Me.Child1.Form!FName2)
    txtLngPIC = txtLngPIC +1
    me.txtLngPIC = txtLngPIC
    Case 3
    Me.Child1.Form!img1.Picture = Nz (Me.Child1.Form!FName3)
    txtLngPIC = txtLngPIC +1
    me.txtLngPIC = txtLngPIC
    End Select

    Exit Sub
    ErrHandler:
    Exit Sub



    424 is the usual error number.

    Has anyone done anything like this before? Suggestions please?


    Thanks

    Pippin

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i'm not sure i'm keen on using the mother timer to drive a child event, but the child timer should handle it with ease.

    possible (and different) construct in the child timer could be
    Code:
    Dim ix As Integer
    Const maxix As Integer = 5
    Const minix As Integer = 1
    
    Private Sub Form_Load()
        Me.TimerInterval = 800
        ix = 0
    End Sub
    
    Private Sub Form_Timer()
        ix = ix + 1
        If ix > maxix Then ix = minix
        Me.pix.Picture = "C:\here\there\elsewhere\somepix" & ix & ".bmp"
        DoEvents
    End Sub
    izy
    currently using SS 2008R2

Posting Permissions

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