This is the code I am using now:
I want the variable to increse by one every time the program loops, but it keeps giving me an error message.Code:Public Sub generatewebpageonead() Dim codenumbertitleloop As Integer Dim codenumberbodyloop As Integer totalrecords = Form3.codetotal codenumbertitleloop = 1 codenumberbodyloop = 1 Do Open (App.Path & "/codes/" & (Form2.address) & "/code" & codenumbertitleloop & ".cdt") For Input As #1 Open (App.Path & "/codes/" & (Form2.address) & "/code" & codenumberbodyloop & ".cdb") For Input As #2 Input #1, temptitle Input #2, tempbody Close #1 Close #2 ----- 'NEED TO MODIFY VARIABLE CODE HERE 'eg: codetitle & codenumbertitleloop = temptitle is invalid MsgBox codenumbertitleloop MsgBox cdbody If codenumbertitleloop = totalrecords Then End codenumbertitleloop = Val(codenumbertitleloop) + 1 codenumberbodyloop = Val(codenumbertitleloop) + 1 Loop
Any way to do this. For example, say i want a varaible
codetitle01 = codetemp
and next time it loops i want the variable to be
codetitle02 = codetemp
Any way to do this?
[Edited by Wrestlecar Webmaster on 08-03-2000 at 04:54 PM]




Reply With Quote