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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested With's -- Refer To Parent With Statement 1

Status
Not open for further replies.

PWise

Programmer
Dec 12, 2002
2,633
US
Code:
Dim Mydb As Database
Set Mydb = CurrentDb
With Mydb.OpenRecordset("Select * from Students", dbOpenDynaset, dbSeeChanges)
    Do Until .EOF
        With Mydb.OpenRecordset("Select * from Sessions Where Studentid = " & !Studentid, dbOpenDynaset, dbSeeChanges)
            Debug.Print !StudentFirstName [COLOR=grenn]'Field in Students table[/color]
        End With
        .MoveNext
    Loop
End With

When I run this code I get this error
Item not found in this collection.

Is there some way that I can indacate that this is from the above(parent) with?
 
Forgot to indacate that I get the error @ this line
Code:
Debug.Print !StudentFirstName 'Field in Students table
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top