Results 1 to 22 of 22

Thread: don't look if you don't want to help a beginner! :)

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2002
    Location
    Seattle
    Posts
    51

    Question don't look if you don't want to help a beginner! :)

    I will give a big kudos if anyone can remotely help me with this, much less understand what I need help on...here goes: whew, okay...i've got some option buttons, I need the user to satisfy both frames with option buttons. I know how to make a message box to ask the user to go back and click on the option button, but how do you take it step by step? Like, how do you make it so that if the user clicks on one frame, but doesn't fulfill the second one, the message box will come up. Right now, the message boxes all come right after one another when clicking the command button.

    Wow! Could anybody understand that and help me?!

  2. #2
    Member phase's Avatar
    Join Date
    Feb 2002
    Location
    Atlanta, GA USA
    Posts
    59
    I didnt understand a word you just said. Lay it out more plainly and tell us what you're actually trying to do, and what its for and then i might be able to help

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Do ALL optButons, on each frame, need to selected by the user?
    ________
    SexxyMolly
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:29 AM.

  4. #4
    Member phase's Avatar
    Join Date
    Feb 2002
    Location
    Atlanta, GA USA
    Posts
    59
    lol bruce i like your quote at the bottom of your thing..rofl

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

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

    You could 'hide' the second Frame until the user has satisfied
    your rquirments on the first.

    VB Code:
    1. Frame2.Visible = False
    ________
    PaoTheMax
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:29 AM.

  7. #7
    Member phase's Avatar
    Join Date
    Feb 2002
    Location
    Atlanta, GA USA
    Posts
    59
    Do you even understand what he is trying to do? I sure dont...
    - phase
    tripflex.com

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

    I have an idea what she is trying to do.
    ________
    Live sex
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:29 AM.

  9. #9
    Addicted Member Pickler's Avatar
    Join Date
    May 2001
    Location
    nffanb
    Posts
    248
    If I understand correctly, you should be able to just use the GotFocus event.
    ie:

    Frame1 with 2 option buttons Opt1 and Opt2
    Frame2 with 2 option buttons Opt3 and Opt4

    VB Code:
    1. Sub Opt3_GotFocus()
    2.   If Opt1.Value=False and Opt2.Value=False then
    3.        MsgBox "Please select from Frame1 options"
    4.   end if
    5.  
    6. End Sub


  10. #10
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    Originally posted by phase
    lol bruce i like your quote at the bottom of your thing..rofl
    He's one funny guy.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  11. #11

    Thread Starter
    Member
    Join Date
    Feb 2002
    Location
    Seattle
    Posts
    51

    I think Pickler is the closest...but it still doesn't work for some reason. I'm sorry about my explanation!

    Okay, take 2--> i have a form that has 2 frames --frame1 with options Undergrad/Grad. frame2 holds Resident/Nonresident. Can you guys tell i'm trying to do a tuition calculation thingie? ANyway, then there's a textbox asking the user to put in how many credits they're taking. Then a command button that calculates the tuition. Wow, I guess that explanation was probably a lot better eh?


    So...I need the user to fill out all frames before pushing "Compute Tuition"

    Is that better?

  12. #12
    Hyperactive Member Dinz's Avatar
    Join Date
    Jan 2002
    Posts
    359
    .......... ....I think what picler has suggested is what u want....

  13. #13
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Similar to what Pickler said,

    Place the check in the Command Button

    VB Code:
    1. Private Sub Command_Click()
    2.  
    3.   If Opt1.Value=False And Opt2.Value=False And Opt2.Value=False And Opt3.Value=False Then
    4.        MsgBox "Please select an option"
    5.   End if
    6.  
    7. End Sub
    ________
    Godess_N_Passion
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:29 AM.

  14. #14

    Thread Starter
    Member
    Join Date
    Feb 2002
    Location
    Seattle
    Posts
    51
    okay, so this is the problem I'm encountering upon doing those statements. if i haven't filled out any of the frames it gives me a message stating i need to choose my class standing. that's great, but opon pressing the ok button, it goes to say i need to select my residency status, then goes to the next please provide a numeric value.

    how do i separate them where each individual error message will display one at a time? when the error is actually made?

  15. #15
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Post ur code
    ________
    Pepper cam
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:30 AM.

  16. #16
    Addicted Member Pickler's Avatar
    Join Date
    May 2001
    Location
    nffanb
    Posts
    248
    Hi Licoricekisses,

    Can you post what code you have.

  17. #17

    Thread Starter
    Member
    Join Date
    Feb 2002
    Location
    Seattle
    Posts
    51
    Please don't laugh at me!! (and the hmm part i'm still figuring out. trying to limit the user with just number values. )




    If optUndergrad.Value = False And optGrad.Value = False Then
    MsgBox "Please select your class standing", vbInformation, "pa4"
    End If

    If optResident.Value = False And optNonresident.Value = False Then
    MsgBox "Please select your resident status", vbInformation, "pa4"
    End If

    If txtNumberCredits.Text = "" Then
    MsgBox "Please provide your number of credits", vbInformation, "pa4"
    If IsNumeric(hmmm) Then
    MsgBox "Please provide a numeric value", vbInformation, "pa4"
    End If
    End If

  18. #18
    Addicted Member Pickler's Avatar
    Join Date
    May 2001
    Location
    nffanb
    Posts
    248
    Cool, no probs.
    There is more than one way to fix this.
    One way.


    VB Code:
    1. If optUndergrad.Value = False And optGrad.Value = False Then
    2.   MsgBox "Please select your class standing", vbInformation, "pa4"
    3. elseIf optResident.Value = False And optNonresident.Value = False Then
    4.   MsgBox "Please select your resident status", vbInformation, "pa4"
    5. elseIf txtNumberCredits.Text = "" Then
    6.   MsgBox "Please provide your number of credits", vbInformation, "pa4"
    7. elseIf IsNumeric(hmmm) Then
    8.   MsgBox "Please provide a numeric value", vbInformation, "pa4"
    9. End If

    PS hmmm=txtNumberCredits.Text

    Hope it helps

  19. #19

    Thread Starter
    Member
    Join Date
    Feb 2002
    Location
    Seattle
    Posts
    51
    wow pickler! thanks a lot! i can't believe i forgot that elseif statement! i totally brain-farted!

    i'm trying to call a function...why won't it let me do it? here, i'll show you...and don't laugh at my redundancy with the function! (how would you alleviate that anyway?)

    Private Sub cmdComputeTuition_Click()

    Dim Standing As String
    Dim Residency As String
    Dim NumberCredits As Integer
    Dim TotalTuition As Currency

    If optUndergrad.Value = False And optGrad.Value = False Then
    MsgBox "Please select your class standing", vbInformation, "pa4"
    ElseIf optResident.Value = False And optNonresident.Value = False Then
    MsgBox "Please select your resident status", vbInformation, "pa4"
    ElseIf txtNumberCredits.Text = "" Then
    MsgBox "Please provide your number of credits", vbInformation, "pa4"
    txtNumberCredits.SetFocus
    Exit Sub
    ElseIf Not IsNumeric(txtNumberCredits) Then
    MsgBox "Please provide a numeric value", vbInformation, "pa4"
    txtNumberCredits.SetFocus
    txtNumberCredits.SelStart = 0
    txtNumberCredits.SelLength = Len(txtNumberCredits.Text)
    Exit Sub
    Else
    NumberCredits = Val(txtNumberCredits.Text)
    End If



    TotalTuition = Cost(Standing, Residency, NumberCredits)
    lblDisplayTuition.Caption = Format(TotalTuition, "Currency")

    End Sub

    Private Function Cost(Standing As String, _
    Residency As String, NumberCredits As Integer) As Currency

    If (Standing = "Undergrad") And (Residency = "Resident") Then
    Cost = 35 * NumberCredits
    ElseIf (Standing = "Undergrad") And (Residency = "Nonresident") Then
    Cost = 65 * NumberCredits
    ElseIf (Standing = "Grad") And (Residency = "Resident") Then
    Cost = 70 * NumberCredits
    ElseIf (Standing = "Grad") And (Residency = "Nonresident") Then
    Cost = 135 * NumberCredits
    End If

    End Function

    WHAT AM I MISSING? hmmm...

  20. #20
    Addicted Member Pickler's Avatar
    Join Date
    May 2001
    Location
    nffanb
    Posts
    248
    I can see where you set the NumberCredits.
    But I can't see where you set your Standing and Residency variables before calling your Cost function.

    From what I can see they should be declared at Form level.
    ( not in your button click event )
    and set when lciking your option buttons.

    Cheers


    ( my chips are getting cold )

  21. #21
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    VB Code:
    1. Option Explicit
    2. Private Sub cmdComputeTuition_Click()
    3.  
    4. Dim Standing As String
    5. Dim Residency As String
    6. Dim NumberCredits As Integer
    7. Dim TotalTuition As Currency
    8.  
    9. If optUndergrad.Value = False And optGrad.Value = False Then
    10.   MsgBox "Please select your class standing", vbInformation, "pa4"
    11. ElseIf optResident.Value = False And optNonresident.Value = False Then
    12.   MsgBox "Please select your resident status", vbInformation, "pa4"
    13. ElseIf txtNumberCredits.Text = "" Then
    14.   MsgBox "Please provide your number of credits", vbInformation, "pa4"
    15.   txtNumberCredits.SetFocus
    16.   Exit Sub
    17. ElseIf Not IsNumeric(txtNumberCredits) Then
    18.   MsgBox "Please provide a numeric value", vbInformation, "pa4"
    19.   txtNumberCredits.SetFocus
    20.   txtNumberCredits.SelStart = 0
    21.   txtNumberCredits.SelLength = Len(txtNumberCredits.Text)
    22.   Exit Sub
    23. Else
    24.   NumberCredits = Val(txtNumberCredits.Text)
    25. End If
    26.  
    27. If optUndergrad Then ' If Undergrad selected = TRUE, then Standing = "Undergrad"
    28.   Standing = "Undergrad"
    29. Else
    30.   Standing = "Grad" ' If optUndergrad = FALSE, then Standing = "Grad"
    31. End If
    32.  
    33. If optResident Then
    34.   Residency = "Resident"
    35. Else
    36.   Residency = "Nonresident"
    37. End If
    38.  
    39. TotalTuition = Cost(Standing, Residency, NumberCredits)
    40. lblDisplayTuition.Caption = Format(TotalTuition, "Currency")
    41.  
    42. End Sub
    43.  
    44. Private Function Cost(Standing As String, _
    45. Residency As String, NumberCredits As Integer) As Currency
    46.  
    47. If (Standing = "Undergrad") And (Residency = "Resident") Then
    48.   Cost = 35 * NumberCredits
    49. ElseIf (Standing = "Undergrad") And (Residency = "Nonresident") Then
    50.   Cost = 65 * NumberCredits
    51. ElseIf (Standing = "Grad") And (Residency = "Resident") Then
    52.   Cost = 70 * NumberCredits
    53. ElseIf (Standing = "Grad") And (Residency = "Nonresident") Then
    54.   Cost = 135 * NumberCredits
    55. End If
    56.  
    57. End Function
    ________
    BUY MFLB
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:30 AM.

  22. #22

    Thread Starter
    Member
    Join Date
    Feb 2002
    Location
    Seattle
    Posts
    51
    Thank you so much! I can't believe I forgot to do that...your help is much appreciated!

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