move next commands

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • indhu
    New Member
    • Oct 2006
    • 140

    #16
    Originally posted by hariharanmca
    i think u have to remove while
    Code:
    Private Sub cmdNext_Click()
    
    Call rLOAD
    
    MsgBox storyboard.RecordCount
    If Not storyboard.EOF Then
    storyboard.MoveNext
    Call Fill
    end if
    End sub
    i tried this. its moving only 2 records not going to last rec.

    Comment

    • hariharanmca
      Top Contributor
      • Dec 2006
      • 1977

      #17
      Originally posted by indhu
      Code:
      Private Sub cmdNext_Click()
      
      Call rLOAD
      
      MsgBox storyboard.RecordCount
      If Not storyboard.EOF Then
      storyboard.MoveNext
      Call Fill
      end if
      End sub
      i tried this. its moving only 2 records not going to last rec.
      accdb= your qry
      Press ctrl+G it will open the immediate window there type

      ? accdb
      it will return the qry value

      copy that value and paste in MSAccess qry editor then run it I think it will return two record

      Comment

      • indhu
        New Member
        • Oct 2006
        • 140

        #18
        Originally posted by hariharanmca
        accdb= your qry
        Press ctrl+G it will open the immediate window there type

        ? accdb
        it will return the qry value

        copy that value and paste in MSAccess qry editor then run it I think it will return two record
        accdb = "SELECT sequence, scenes, filename, panel, action, dialogue FROM panel WHERE scenes = '" & scenecombo.Text & "'"

        ?accdb

        i tried it in immediate window not returning anything

        tbl has 3 rec for tht id Hari,

        Comment

        • hariharanmca
          Top Contributor
          • Dec 2006
          • 1977

          #19
          Originally posted by indhu
          accdb = "SELECT sequence, scenes, filename, panel, action, dialogue FROM panel WHERE scenes = '" & scenecombo.Text & "'"

          ?accdb

          i tried it in immediate window not returning anything

          tbl has 3 rec for tht id Hari,

          what is in Call dataFill

          Ok, Post the complete function
          and
          you have keep breakpoint after
          accdb = "SELECT sequence, scenes, filename, panel, action, dialogue FROM panel WHERE scenes = '" & scenecombo.Text & "'"


          line

          then use that window

          Comment

          • indhu
            New Member
            • Oct 2006
            • 140

            #20
            Originally posted by hariharanmca
            what is in Call dataFill

            Ok, Post the complete function
            and
            you have keep breakpoint after
            accdb = "SELECT sequence, scenes, filename, panel, action, dialogue FROM panel WHERE scenes = '" & scenecombo.Text & "'"


            line

            then use that window
            Sub Fill()

            secombo = storyboard!seq1
            sc1combo = storyboard!sc1
            pan_txt.Text = storyboard!Pan
            Image1.Picture = LoadPicture(App .Path & "\images\" & storyboard("fil ename"))
            act_txt.Text = storyboard!Act
            dial_txt.Text = storyboard!dial
            End Sub

            Comment

            • hariharanmca
              Top Contributor
              • Dec 2006
              • 1977

              #21
              Originally posted by indhu
              Sub Fill()

              secombo = storyboard!seq1
              sc1combo = storyboard!sc1
              pan_txt.Text = storyboard!Pan
              Image1.Picture = LoadPicture(App .Path & "\images\" & storyboard("fil ename"))
              act_txt.Text = storyboard!Act
              dial_txt.Text = storyboard!dial
              End Sub

              you are calling dataFill

              and detail code about function and calling function

              Comment

              • indhu
                New Member
                • Oct 2006
                • 140

                #22
                Originally posted by hariharanmca
                you are calling dataFill

                and detail code about function and calling function
                Code:
                Sub rLOAD()
                
                Set storyboard = New ADODB.Recordset
                ' Open Recordset
                If CON.State = 1 Then
                    MsgBox "Connection is opened"
                Else
                    MsgBox "Connection is not opened"
                End If
                
                storyboard.Open "SELECT seq, sc1, images, pan, act, dial FROM  xyzTBL WHERE sc1 = '" & sc1combo.Text & "'", CON, adOpenStatic, adLockReadOnly

                these 2 procedure only am using in cmdnext

                Comment

                • hariharanmca
                  Top Contributor
                  • Dec 2006
                  • 1977

                  #23
                  Originally posted by indhu
                  Code:
                  Sub rLOAD()
                  
                  Set storyboard = New ADODB.Recordset
                  ' Open Recordset
                  If CON.State = 1 Then
                      MsgBox "Connection is opened"
                  Else
                      MsgBox "Connection is not opened"
                  End If
                  
                  storyboard.Open "SELECT seq, sc1, images, pan, act, dial FROM  xyzTBL WHERE sc1 = '" & sc1combo.Text & "'", CON, adOpenStatic, adLockReadOnly

                  these 2 procedure only am using in cmdnext

                  because of this code this is not moving next

                  1 Set storyboard = New ADODB.Recordset 'storyboard having New Instance
                  2 storyboard.Open "SELECT seq, sc1, images, pan, act, dial FROM xyzTBL WHERE sc1 = '" & sc1combo.Text & "'", CON, adOpenStatic, adLockReadOnly

                  ' at the every click of nextCommandbutt on the record set open again

                  Comment

                  • indhu
                    New Member
                    • Oct 2006
                    • 140

                    #24
                    Originally posted by hariharanmca
                    because of this code this is not moving next

                    1 Set storyboard = New ADODB.Recordset 'storyboard having New Instance
                    2 storyboard.Open "SELECT seq, sc1, images, pan, act, dial FROM xyzTBL WHERE sc1 = '" & sc1combo.Text & "'", CON, adOpenStatic, adLockReadOnly

                    ' at the every click of nextCommandbutt on the record set open again
                    what i ve to do for this.
                    i ve commented recordset line, 2 line declared as accdb= that query.
                    but now its giving error in sc1comboclick_e vent
                    runtime error item cannot be found in collection or ordinal name.

                    Comment

                    • hariharanmca
                      Top Contributor
                      • Dec 2006
                      • 1977

                      #25
                      Originally posted by indhu
                      what i ve to do for this.
                      i ve commented recordset line, 2 line declared as accdb= that query.
                      but now its giving error in sc1comboclick_e vent
                      runtime error item cannot be found in collection or ordinal name.
                      no, you have to give those lines but not here like

                      move next,move prev,move last,move first because these are the code execute after the record set open once. so you should not give here.

                      give in form load (but its not the correct way).

                      Comment

                      • indhu
                        New Member
                        • Oct 2006
                        • 140

                        #26
                        Originally posted by hariharanmca
                        no, you have to give those lines but not here like

                        move next,move prev,move last,move first because these are the code execute after the record set open once. so you should not give here.

                        give in form load (but its not the correct way).
                        hey its working, i didn't set recordset to execute. thaty its given that error. but y my record count is showing -1

                        Comment

                        • hariharanmca
                          Top Contributor
                          • Dec 2006
                          • 1977

                          #27
                          Originally posted by indhu
                          hey its working, i didn't set recordset to execute. thaty its given that error. but y my record count is showing -1

                          because of cursor type and lock type

                          Comment

                          • indhu
                            New Member
                            • Oct 2006
                            • 140

                            #28
                            Originally posted by indhu
                            hey its working, i didn't set recordset to execute. thaty its given that error. but y my record count is showing -1
                            Code:
                            Private Sub Form_Load()
                            
                            Set CON = New ADODB.Connection
                            CON.CursorLocation = adUseClient
                            
                            myconnection
                            
                            Call tblLOAD
                            projecttxt.Text = storyboard!project
                            'episode.Text = storyboard!episode
                            
                            storyboard.MoveFirst
                            
                            Call sceneLOAD
                            
                            Do While Not storyboard.EOF
                            scenecombo.AddItem storyboard!sceneid 'List all the sceneID items into the ComboBox
                            storyboard.MoveNext
                            Loop
                            ' Close  Recordset
                            storyboard.close
                            
                            ' Clear the memory
                            Set storyboard = Nothing
                            
                            End Sub
                            this is my form load coding.

                            Comment

                            • Killer42
                              Recognized Expert Expert
                              • Oct 2006
                              • 8429

                              #29
                              Originally posted by indhu
                              hey its working, i didn't set recordset to execute. thaty its given that error. but y my record count is showing -1
                              I'm not sure of the exact circumstances, but sometimes you have to MoveLast before the RecordCount is properly calculated. The -1 is probably just intended as a True flag to indicate that records were found. If you do a MoveLast then MoveFirst, you'll probably get the correct count.

                              Comment

                              • hariharanmca
                                Top Contributor
                                • Dec 2006
                                • 1977

                                #30
                                Originally posted by indhu
                                Code:
                                Private Sub Form_Load()
                                
                                Set CON = New ADODB.Connection
                                CON.CursorLocation = adUseClient
                                
                                myconnection
                                
                                Call tblLOAD
                                projecttxt.Text = storyboard!project
                                'episode.Text = storyboard!episode
                                
                                storyboard.MoveFirst
                                
                                Call sceneLOAD
                                
                                Do While Not storyboard.EOF
                                scenecombo.AddItem storyboard!sceneid 'List all the sceneID items into the ComboBox
                                storyboard.MoveNext
                                Loop
                                ' Close  Recordset
                                storyboard.close
                                
                                ' Clear the memory
                                Set storyboard = Nothing
                                
                                End Sub
                                this is my form load coding.

                                Give in this way
                                Before opening the record set, give
                                Set storyboard = Nothing
                                storyboard.Curs orLocation = adUseClient
                                storyboard.Open strYourQry, Connection, adOpenDynamic, adLockReadOnly

                                then you can get record count value

                                Comment

                                Working...