Results 1 to 8 of 8

Thread: Creating a popup window for results

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    4

    Creating a popup window for results

    Hi all! As you may or may not know, I am returning to the VB world after being away from VB for about 4 years or so. I could really use some help with my coding, so please bear with me. I may ask some simple questions from time to time. I just hope that you all have some patience when it comes to my lack of knowledge.

    I'm working on this program for my job. It will ultimately calculate ideal yield per sheet of material. I am first attempting to code the math portion of the program & have already ran into problems. Could someone please tell me how to create a popup window that would show the results of my math? I have several text boxes where users will enter integers and users will click on the "Calculate" button to perform the math. For now, I just want to verify my math via a popup window, but do not know how to create one. If someone could please help me out with this, I would really appreciate it. Thanks in advance!

  2. #2
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    Better off putting this is the VB5/6 forum.

    What kind of popup,

    Messagebox
    form
    msn messenger type popup etc?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    4
    Oh sorry. Hopefully the admin will move this thread.

    Anyways, I'm looking to multiply the values of 2 text boxes and have the result show in a message box. I have the syntax down for showing a message box, but do not know how to show the results of the multiplication operation. Can you help? Thanks!

  4. #4
    Member
    Join Date
    Jun 2003
    Posts
    39
    MsgBox CStr(ValueA * ValueB), vbOkOnly, "Calc Result"

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    4
    Thanks, I got the coding down for this section for the most part. Now what I'm trying to do is to multiply 2 values together & then add a value to that result. Here's the code I have which doesn't work...

    Dim Multiply As Integer
    Dim Result As Integer
    Multiply = Val(pieceheight.Text) * Val(piecewidth.Text) + Val(kerf.Text)
    Result = MsgBox(Val(Multiply), vbOKOnly + vbInformation, "Total Square Inches")

    When I run the program the values of the "pieceheight" & "piecewidth" get multiplied together, but the addition of the "kerf" value does not get added to the result. If I change the + sign to a * sign, it works fine. Anyone have any suggestions as to fix this? Thanks!

  6. #6
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228
    Try declaring the multiply variable as a long.

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    4
    Yeah, I recently realized that the variable declaration was an integer instead of a float (long). I realized this one night right before I fell asleep in bed. It's weird where & when you think of the answers to problems, huh?

    Next step in the program is to complete the math in the program, then onto the graphical section of the program (gonna be real tough I think!)

    Thanks for your help so far!

  8. #8
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Smile don't worry.

    Don't worry everyone's here to help.

    Cheers,
    Abhijit

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