|
-
Apr 12th, 2002, 09:36 PM
#1
Thread Starter
Hyperactive Member
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
-
Apr 12th, 2002, 09:51 PM
#2
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:
Dim sglDepth As Long
Do While sglDepth < 335
Data.Recordset.AddNew "Depth", sglDepth
sglDepth = sglDepth + 0.5
Loop
MsgBox "Done"
-
Apr 12th, 2002, 10:53 PM
#3
Ha ha ha! I remember when I used an integer and wondered why it was doing nothing when I added 0.1...
-
Apr 13th, 2002, 12:32 AM
#4
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|