Results 1 to 4 of 4

Thread: [RESOLVED] Countdown Problem

  1. #1

    Thread Starter
    Hyperactive Member Rattled_Cage's Avatar
    Join Date
    Dec 2005
    Posts
    315

    Resolved [RESOLVED] Countdown Problem

    Code:
    Private Sub Command1_Click()
    Text1.Text = Text1.Text - 1
    End Sub
    
    Private Sub Form_Load()
    Text1.Text = "99999999999999999"
    End Sub
    
    '''how do i stop it from counting down to 1E+17 and display numbers instead

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Countdown Problem

    Try using the FormatNumber function. Change vbFalse to vbTrue to show digit separators.

    Text1.Text = FormatNumber(Val(Text1.Text)-1,0,,, vbFalse)
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: Countdown Problem

    This will get you just under the first million of them:
    Code:
    Private Sub Command1_Click()
    Text1.Text = Left$(Text1.Text, 11) & Format$(Val(Mid$(Text1.Text, 12, 6) - 1), "######")
    End Sub
    
    Private Sub Form_Load()
    Text1.Text = "99999999999999999"
    End Sub
    How many do you need?
    Last edited by Code Doc; Jun 19th, 2009 at 06:48 PM.
    Doctor Ed

  4. #4

    Thread Starter
    Hyperactive Member Rattled_Cage's Avatar
    Join Date
    Dec 2005
    Posts
    315

    Re: Countdown Problem

    ah many thanks just the stuff : )

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