Results 1 to 6 of 6

Thread: agh n00b problems!

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    2

    Question agh n00b problems!

    hey all iam a total noob at vb need a bit of help......


    Private Sub cmd_cancel_Click()
    MsgBox "Are you sure you want to cancel your order?", vbYesNo, "Cancel Order?"
    If vbYes Then
    frm_page1.Refresh
    frm_page0.Visible = True
    frm_page1.Visible = False
    End If
    End Sub

    frm_page1.refresh isnt refreshing page... plz help.... ta.

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: agh n00b problems!

    Welcome to the Forum


    Something like:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub cmd_cancel_Click()
    4.     [b]If[/b] MsgBox("Are you sure you want to cancel your order?", vbYesNo [b]+ vbQuestion[/b], "Cancel Order?") = vbYes Then
    5.         frm_page1.Refresh
    6.         frm_page0.Visible = True
    7.         frm_page1.Visible = False
    8.     End If
    9. End Sub

    NB: Added a question mark too.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: agh n00b problems!

    Welcome to the forums.

    Refresh cause's a repaint of a form or control. This might not be what you think refresh should be doing (Refresh does not work on MDI Parents, but will on MDI Child forms).

    What are you attempting to do with the refresh?

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    2

    Re: agh n00b problems!

    just trying to refresh the page option boxes

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: agh n00b problems!

    Quote Originally Posted by remo656
    just trying to refresh the page option boxes
    Again I ask, what do you mean by "refresh"? Change? Set?

    What are "option boxes"? Option Buttons? Checkboxes?

  6. #6
    Addicted Member
    Join Date
    Mar 2006
    Posts
    178

    Re: agh n00b problems!

    As hack says the forms Refresh method does not re-initialise any data on the form, it only repaints the form. You have to do that yourself, i.e.

    VB Code:
    1. txtAmount.Text = vbNullString
    2. optOption1.Value = False
    If a post has been helpful, Rate it!

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