move next commands

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #46
    Originally posted by indhu
    if i give movefirst, it shows only first recset. not the consecutive recset.
    No indhu, i think you are in the wrong way......

    just explain your problem and then what you need.

    Comment

    • willakawill
      Top Contributor
      • Oct 2006
      • 1646

      #47
      Originally posted by hariharanmca
      No indhu, i think you are in the wrong way......

      just explain your problem and then what you need.
      I warned you :)

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #48
        Originally posted by willakawill
        I warned you :)
        My head hurts just trying to follow this thread.

        However, allow me to risk one question...

        indhu, why can't your "next" button simply do a MoveNext and (if necessary) load values into form controls? A While loop doesn't seem to make much sense in such a situation.

        To get much more help here, I think you really need to start over and lay out the problem very clearly, giving precise details of what you have now (or had when the thread started) and what is wrong with it.

        Comment

        • indhu
          New Member
          • Oct 2006
          • 140

          #49
          Originally posted by Killer42
          My head hurts just trying to follow this thread.

          However, allow me to risk one question...

          indhu, why can't your "next" button simply do a MoveNext and (if necessary) load values into form controls? A While loop doesn't seem to make much sense in such a situation.

          To get much more help here, I think you really need to start over and lay out the problem very clearly, giving precise details of what you have now (or had when the thread started) and what is wrong with it.
          i want to select sceneid from combo. then other field has to populate.
          sceneid frm scenetbl
          otherfields frm paneltbl. sceneid is fk in paneltbl
          thats it. sorry guys.

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #50
            Originally posted by willakawill
            I warned you :)

            Warning doesn’t make any sense, because I think Indhu is very new to VB that’s why she/he can’t explain what his/her problem; let me to follow him/her way to solve the problem.

            Comment

            • hariharanmca
              Top Contributor
              • Dec 2006
              • 1977

              #51
              Originally posted by indhu
              i want to select sceneid from combo. then other field has to populate.
              sceneid frm scenetbl
              otherfields frm paneltbl. sceneid is fk in paneltbl
              thats it. sorry guys.
              Code:
              Dim conn As New ADODB.Connection
              Dim rstRecordSet As New ADODB.Recordset
              Dim strSql As String
              
              Private Sub Combo1_Change()
                  Combo1_Click
              End Sub
              
              Private Sub Combo1_Click()
                  strSql = ""
                  strSql = "select field0,field1,field2,field3 from tblOtherTable where TableId = " & Combo1.ItemData(Combo1.ListIndex)
                  Set rstRecordSet = Nothing
                  rstRecordSet.CursorLocation = adUseClient
                  rstRecordSet.Open strSql, conn, adOpenDynamic, adLockOptimistic
                  If rstRecordSet.RecordCount > 0 Then
                      Text1.Text = rstRecordSet.Fields("field0")
                      Text2.Text = rstRecordSet.Fields("field1")
                      Text3.Text = rstRecordSet.Fields("field2")
                      Text4.Text = rstRecordSet.Fields("field3")
                  End If
                  Set rstRecordSet = Nothing
              End Sub
              
              Private Sub Form_Load()
                  LoadComboDetail
              End Sub
              
              Private Sub LoadComboDetail()
                  Dim i As Integer
                  strSql = ""
                  strSql = "select TableId,TableFetchDetail from tblTableName"
                  Set rstRecordSet = Nothing
                  rstRecordSet.CursorLocation = adUseClient
                  rstRecordSet.Open strSql, conn, adOpenDynamic, adLockOptimistic
                  If rstRecordSet.RecordCount > 0 Then
                      For i = 1 To rstRecordSet.RecordCount
                          Combo1.AddItem rstRecordSet("TableFetchDetail")
                          Combo1.ItemData(Combo1.NewIndex) = rstRecordSet("TableId")
                          rstRecordSet.MoveNext
                      Next i
                  End If
                  Set rstRecordSet = Nothing
              End Sub

              Just go through this code, i think this is what you are looking for.......
              Last edited by Killer42; Feb 22 '07, 06:14 AM. Reason: Please remember to use CODE tags

              Comment

              • indhu
                New Member
                • Oct 2006
                • 140

                #52
                Just go through this code, i think this is what you are looking for.......
                yeah, thats what i am trying to do, thanks.

                type mismatch error
                Code:
                scenecombo.ItemData(scenecombo.NewIndex) = rstRecordSet("sceneid")

                Comment

                • hariharanmca
                  Top Contributor
                  • Dec 2006
                  • 1977

                  #53
                  Originally posted by indhu
                  yeah, thats what i am trying to do, thanks.

                  type mismatch error
                  Code:
                  scenecombo.ItemData(scenecombo.NewIndex) = rstRecordSet("sceneid")

                  are you sure value of rstRecordSet("s ceneid") is numeric

                  Comment

                  • willakawill
                    Top Contributor
                    • Oct 2006
                    • 1646

                    #54
                    Originally posted by hariharanmca
                    Warning doesn’t make any sense, because I think Indhu is very new to VB that’s why she/he can’t explain what his/her problem; let me to follow him/her way to solve the problem.
                    This was the original warning:
                    Au contraire. I am not too willing to continually work out an entire app for someone who always posts work everyone else has done for him not understanding it himself. Makes for a long drawn out botomless pit of suggestions
                    As we are now on page 6 with no real end in sight I think my warning makes perfect sense. Glad you have the stamina to stay with it. In the meantime I have helped more than a hundred others which I consider a better use of my time.

                    Comment

                    • zura
                      New Member
                      • Feb 2007
                      • 1

                      #55
                      i need help on Ms Access Form..
                      i have 3 table and i need to join this 3 table to create a form..
                      I created the form using wizard but i cant add any new record to the form..

                      If i create the form saperately then only i can add the new rocords..

                      So can anyone please help me out on this?

                      Thank you in advance..
                      Last edited by willakawill; Feb 22 '07, 07:22 AM. Reason: please post this in your own thread

                      Comment

                      • indhu
                        New Member
                        • Oct 2006
                        • 140

                        #56
                        Originally posted by zura
                        i need help on Ms Access Form..
                        i have 3 table and i need to join this 3 table to create a form..
                        I created the form using wizard but i cant add any new record to the form..

                        If i create the form saperately then only i can add the new rocords..

                        So can anyone please help me out on this?

                        Thank you in advance..
                        Use relationship for those 3 tables and try using wizard to create ur form..

                        Comment

                        Working...