Results 1 to 4 of 4

Thread: Refresh Information

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2001
    Posts
    759
    Hi Everyone,

    I currently have two forms named Members and New Members. The Members form has a bunch of text boxes filled with existing member information (i.e. First name, Last name, etc). At the bottom of the form there is a command button that opens up the New Members form. The new members form has several text boxes that need to be filled out in order to accept a new member. Once all fields in the new members form are filled out correctly and the user sends the information to the database the new member form is hidden from view (still leaving the original members form open). My question is this. Once a new member has been added to the database from the new members form, how can I get the original Members form to reload or update to show the new members information without shutting the program down and then restarting it? I would appreciate any help. Thank you.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    you'll need to run the SQL statement over again to refresh the data. How are you getting the data, from a DataEvironment, or ADO recordset,or...?
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2001
    Posts
    759

    Refresh Information

    How do I set this up? I am using ADO. Do I need to run the SQL statement from the new members form right before I hide it? Please let me know where I should put the SQL statement. Thanks for your help.

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I assume that you're using a control array for your textboxes and that the DataField prop is set at Design time...
    Code:
    Dim rsMembers As New ADODB.RecordSet
    
    'frmNewMembers
    Private Sub Form_UnLoad(Cancel As Integer)
      Call frmMembers.RefreshList
    End Sub
    
    'frmMembers
    Private Sub RefreshList()
      With rsMembers
        'ActiveConnection, LockType,CursorType, blah,blah,blah
        .Source = "Members"
        .Open Options:=adCmdTable
       
        For Each Control In Me
           If TypeOf Control Is TextBox Then
             Set Control.DataSource = rsMembers
           End IF
       Next
     
       .Close
    End Sub
    something like that...
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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