|
-
Nov 8th, 2008, 04:59 AM
#4
Thread Starter
Fanatic Member
Re: Skipping in for loop
 Originally Posted by dee-u
You could set a condition inside the loop, using INSTR function to determine the existence of '/' in the data....
I used the coding Below but not working.
Private Sub Command1_Click()
rs.Open "check1", db, 3, 2
If InStr(no1, "/") > 0 Then
a = Left([no1], InStr([no1], "/") - 1)
b = Right([no1], Len([no1]) - InStr([no1], "/"))
c = a / b
Call calc
Else
no1 = no1 / 1
Call calc
End If
rs.Close
End Sub
Private Sub Form_Load()
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Bharani\Desktop\New Folder (2)\check.mdb;Persist Security Info=False"
End Sub
Private Sub calc()
rs.Open "check2", 3, 2
rs.AddNew
rs.Fields(0) = no1
rs.Update
rs.Close
End Sub
My output needs to be 5.5, 2.67, 7, 9
which must be added to database
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
|