Results 1 to 12 of 12

Thread: refreshing a form

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    4

    Post

    Is there any way of refreshing or reloading a form without unloading and then having to reload again??? If anyone knows, please tell me, I'm only a beginner you see...

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Post

    Do you mean where you hide the form then want to recall it for future use? If you just hide the form:
    Form1.Hide
    and show the form
    Form1.Show
    this keeps the form in memory so if it complicated it loads faster.

    ------------------
    DiGiTaIErRoR
    VB, QBasic, Iptscrae, HTML
    Quote: There are no stupid questions, just stupid people.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    4

    Post

    no.. I din't want to hide it, I know how to do that, I wanted to refresh it, so that all of the datafields would reset and the form reloads...

  4. #4
    Member
    Join Date
    Mar 1999
    Location
    Louisville, KY
    Posts
    48

    Post

    I'm not sure I understand the question. Are you asking how to clear the controls on a form?

  5. #5
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163

    Post

    If your just trying to refresh the data fields, why don't you just refresh the recordset(s)

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    4

    Post

    ok the, how do you reset the controlls on a form..?

  7. #7
    Lively Member
    Join Date
    Feb 2000
    Location
    Dayton, OH USA
    Posts
    119

    Post

    Did you ever figure out how to do this? I have the same problem....


  8. #8
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163

    Post

    If you are using a data control, you just need to call the refresh method of the data control: data1.refresh, this should update all the linked controls.

  9. #9
    Lively Member
    Join Date
    Jan 2000
    Posts
    76

    Post

    DO Form.refresh
    Majority of the controls have refresh property

  10. #10
    Lively Member
    Join Date
    Feb 2000
    Location
    Dayton, OH USA
    Posts
    119

    Post

    I think he is having the same problem as I. I tried the form.refresh with no luck. Since my form populates its text boxes when the form loads that appears to be the only way to do it, close the form and re-open it. There has to be another way!


  11. #11
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    If you populate your Controls in the Forms Load Event, there's nothing to stop you calling that same Event in a Buttons Click Event, Alternatively create a Sub in the Form for setting the Default Values of your Controls, then call this from both the Form Load Event and the Reset Button Click Event, ie.
    Code:
    Private Sub Form_Load()
        Text1 = "Default"
        Check1 = 0
        List1.Clear
    End Sub
    
    Private Sub cmdReset_Click()
        Form_Load
    End Sub

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Certified AllExperts Expert

  12. #12
    Member
    Join Date
    Jan 2000
    Location
    Singapore
    Posts
    59

    Post

    Hi,
    I am not sure what are the controls you are using to update a record to the database.
    here is some options:
    1: If you are using datacontrol use refresh method and movelast to see the last updated record.otherwise it will go to the first record after updating.

    2: The same movelast if you are using recordset.

    3: if you are using dataenvironment you need to reset all the textboxes with the respective datamember,datasource and the databfield again to see online update.

    If you want anything more just paste your code here. I will try my best.

    Because I had the same problem and I solved it.I was using dataenvironment.

    thanks
    karun

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