Results 1 to 4 of 4

Thread: Im Lazy LOL

  1. #1

    Thread Starter
    Hyperactive Member ZeroCool's Avatar
    Join Date
    Feb 2002
    Location
    In front of my computer
    Posts
    423

    Im Lazy LOL

    I Have To make a table with 670 Records

    Ex.

    0.0
    0.5
    1.0
    1.5....

    But I Dont Want to Fill These In by my self i want to write a simple program to do this one time but i cant get this to work

    Code:
    Dim intDepth As Integer
    If intDepth < 335 Then
    Data.Recordset.AddNew "Depth", intDepth
    intDepth = intDepth + 0.5
    Exit Sub
    Else: End If
    MsgBox "Done"
    I Am Using A ADODC Control Plz Help

  2. #2
    WorkHorse
    Guest
    1. Adding .5 to an integer isn't going to get you anywhere because integers are whole numbers. Use a Single.

    2. Exit Sub or End If (in your code it would have to do one of these two things) would end your routine, which means it could only add .5 once. Use a loop. Either For..Next or Do...Loop.

    VB Code:
    1. Dim sglDepth As Long
    2.  
    3. Do While sglDepth < 335
    4.     Data.Recordset.AddNew "Depth", sglDepth
    5.     sglDepth = sglDepth + 0.5
    6. Loop
    7. MsgBox "Done"

  3. #3
    Dreamlax
    Guest
    Ha ha ha! I remember when I used an integer and wondered why it was doing nothing when I added 0.1...

  4. #4

    Thread Starter
    Hyperactive Member ZeroCool's Avatar
    Join Date
    Feb 2002
    Location
    In front of my computer
    Posts
    423
    Thanks LoL I Didnt think i was that dumb

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