Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quotes and Syntax

Status
Not open for further replies.

ASQ

Programmer
Joined
May 31, 2002
Messages
7
Location
BE
Need help with the following. I am trying to make a loop and make it add record1, record2… to 8. It counts fine but it is having issues (like me) updating a DB. I need help with correct syntax.

Do While not loopcount < 9

Varx1 = “rst.Record” & loopcount & “text1”
Varx2 = “Me!Record” & loopcount & “text1”

rst.AddNew
Varx1 = Varx2
rst.Update
'instead of passing the value of the form Me!record1text it
' pass's the vale &quot;Me!record1text&quot;, which does not help me?

Loopcount = loopcount + 1
Loop

It adds 8 records great but with no data?
Thanks
 
I am kinda new at this also, but from what i have learnt so far i think all you have to do is take the quotes out

Varx1 = “rst.Record” & loopcount & “text1”
Varx2 = “Me!Record” & loopcount & “text1”

should read like this

Varx1 = rst.Record & loopcount & text1
Varx2 = Me!Record & loopcount & text1

Or maybe this

Varx1 = [rst.Record] & loopcount & [text1]
Varx2 = [Me!Record] & loopcount & [text1]


i am assuming that text1 is the fieldname

hope this may help u
raven

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top