Results 1 to 5 of 5

Thread: MoveNext

  1. #1
    Join Date
    Sep 2003
    Location
    Philadelphia, PA
    Posts
    3

    Question Unanswered: MoveNext

    I have some vba code that will not work properly .. can someone help ... the Db contains 3 records but the form only displays 2 ... what am i doing wrong

    Private Sub cmdNext_Click()

    Rec.Open "tblRequest", Conn, adOpenDynamic, adLockOptimistic
    If Not Rec.EOF = True Then Rec.MoveNext

    txtChangeID.Value = Rec("ChangeID")
    txtStatus.Value = Rec("Status")
    cboRequestor.Value = Rec("Requestor")
    txtRequestDate.Value = Rec("RequestDate")
    txtCompRequestDate.Value = Rec("CompRequestDate")
    cboBusinessArea.Value = Rec("BusinessArea")
    cboContactPerson.Value = Rec("ContactPerson")
    txtBriefDescrip.Value = Rec("BriefDescrip")
    txtDescripofChange.Value = Rec("DescripofChange")
    cboDeptPriority.Value = Rec("DeptPriority")
    txtBusinessDrivers.Value = Rec("BusinessDrivers")
    cboReactionChannel.Value = Rec("ReactionChannel")
    cboTypeofChange.Value = Rec("TypeofChange")
    cboApplication.Value = Rec("Application")

    Rec.Close

    End Sub

  2. #2
    Join Date
    Sep 2003
    Location
    Cincinnati, Oh USA
    Posts
    203

    Re: MoveNext

    What is the db base type (i.e. access) and how are you displaying it in your form (flexgrid, or in text boxes)?


    I have some vba code that will not work properly .. can someone help ... the Db contains 3 records but the form only displays 2 ... what am i doing wrong

    Private Sub cmdNext_Click()

    Rec.Open "tblRequest", Conn, adOpenDynamic, adLockOptimistic
    If Not Rec.EOF = True Then Rec.MoveNext

    txtChangeID.Value = Rec("ChangeID")
    txtStatus.Value = Rec("Status")
    cboRequestor.Value = Rec("Requestor")
    txtRequestDate.Value = Rec("RequestDate")
    txtCompRequestDate.Value = Rec("CompRequestDate")
    cboBusinessArea.Value = Rec("BusinessArea")
    cboContactPerson.Value = Rec("ContactPerson")
    txtBriefDescrip.Value = Rec("BriefDescrip")
    txtDescripofChange.Value = Rec("DescripofChange")
    cboDeptPriority.Value = Rec("DeptPriority")
    txtBusinessDrivers.Value = Rec("BusinessDrivers")
    cboReactionChannel.Value = Rec("ReactionChannel")
    cboTypeofChange.Value = Rec("TypeofChange")
    cboApplication.Value = Rec("Application")

    Rec.Close

    End Sub [/SIZE][/QUOTE]

  3. #3
    Join Date
    Sep 2003
    Location
    Philadelphia, PA
    Posts
    3

    Re: MoveNext

    I am using a MS Access db ... and displaying it in text boxes.


    Originally posted by RickKnight
    What is the db base type (i.e. access) and how are you displaying it in your form (flexgrid, or in text boxes)?


    I have some vba code that will not work properly .. can someone help ... the Db contains 3 records but the form only displays 2 ... what am i doing wrong

    Private Sub cmdNext_Click()

    Rec.Open "tblRequest", Conn, adOpenDynamic, adLockOptimistic
    If Not Rec.EOF = True Then Rec.MoveNext

    txtChangeID.Value = Rec("ChangeID")
    txtStatus.Value = Rec("Status")
    cboRequestor.Value = Rec("Requestor")
    txtRequestDate.Value = Rec("RequestDate")
    txtCompRequestDate.Value = Rec("CompRequestDate")
    cboBusinessArea.Value = Rec("BusinessArea")
    cboContactPerson.Value = Rec("ContactPerson")
    txtBriefDescrip.Value = Rec("BriefDescrip")
    txtDescripofChange.Value = Rec("DescripofChange")
    cboDeptPriority.Value = Rec("DeptPriority")
    txtBusinessDrivers.Value = Rec("BusinessDrivers")
    cboReactionChannel.Value = Rec("ReactionChannel")
    cboTypeofChange.Value = Rec("TypeofChange")
    cboApplication.Value = Rec("Application")

    Rec.Close

    End Sub
    [/SIZE][/QUOTE]

  4. #4
    Join Date
    Sep 2003
    Location
    Cincinnati, Oh USA
    Posts
    203

    Re: MoveNext

    Your using a button to navigate the record with (or so it appears)? Why not use the ADODC control. What I'm seeing in this code is that you are are connecting to the access database through this button code and each time you click the button you reconnect (not a good method). I would (and 'I would' is the operative word) use the ADODC control to attach to the db tables and to navigate with. I think that if you changed the binding to the db to adodc (ado) you will populate the form with all records.
    Good luck

    Originally posted by newjack
    I am using a MS Access db ... and displaying it in text boxes.


    [/SIZE][/QUOTE]
    Last edited by RickKnight; 10-01-03 at 13:03.

  5. #5
    Join Date
    Sep 2003
    Location
    Philadelphia, PA
    Posts
    3

    Re: MoveNext

    Can you tell me how to do that?


    Originally posted by RickKnight
    Your using a button to navigate the record with (or so it appears)? Why not use the ADODC control. What I'm seeing in this code is that you are are connecting to the access database through this button code and each time you click the button you reconnect (not a good method). I would (and 'I would' is the operative word) use the ADODC control to attach to the db tables and to navigate with. I think that if you changed the binding to the db to adodc (ado) you will populate the form with all records.
    Good luck

    [/SIZE][/QUOTE]

Posting Permissions

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