Results 1 to 10 of 10

Thread: [RESOLVED] help

Hybrid View

  1. #1
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: help

    something like this?

    if too many then ask the user if they want to just use whats there...
    if No.. exits sub
    if yes.. then.. do your code
    VB Code:
    1. If ship2_no.Text Then
    2.         metal1 = ship2_no.Text * 300
    3.         metalt = CLng(Label1.Caption - metal1)
    4.        
    5.         If metal1 > metalt Then
    6.             If MsgBox("Not enough to build that many! Would you like to use whats available? (" & _
    7.             Label1.Caption & ")", vbYesNo + vbQuestion, "Not Enough") = vbNo Then Exit Sub
    8.             metal1 = metalt
    9.             'do othe code..
    10.            
    11.         End If
    12.     End If
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    Addicted Member
    Join Date
    Apr 2006
    Location
    USA
    Posts
    207

    Re: help

    It looks like Static is heading you in the right direction. How about this slight tweak ?
    VB Code:
    1. If ship2_no.Text Then
    2.     metal1 = ship2_no.Text * 300
    3.     metalt = CLng(Label1.Caption - metal1)
    4.    
    5.     If metal1 > metalt Then
    6.         If MsgBox("Not enough to build that many! Would you like to use whats available? (" & _
    7.         Label1.Caption & ")", vbYesNo + vbQuestion, "Not Enough") = vbNo Then Exit Sub
    8.         metal1 = metalt
    9.        
    10.         'do othe code... Build the maximum amount
    11.     Else
    12.         'there's enough, so build it.
    13.     End If
    14. End If
    Keith_VB6

    If you have any further questions, just ask.
    If this solves things, then please mark the thread resolved.
    [Thread Tools] --> [Mark Thread Resolved]

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