Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Running query while tables linked (Access 2003)

    I have a query that won't run while table links are in force. I had this problem with a select query until making it append. Can I modify the code below to enable it to be run while links are in force? Many thanks.

    Set rsAllAthletes = CurrentDb.OpenRecordset("AllAthletes", dbOpenDynaset)
    Set rsJUNCTION = CurrentDb.OpenRecordset("JUNCTION", dbOpenDynaset)
    Set rsQRYTOP = CurrentDb.OpenRecordset("QRYTOP", dbOpenDynaset)

    Do While Not rsAllAthletes.EOF
    rsJUNCTION.AddNew
    rsJUNCTION.Fields("ID2") = rsAllAthletes.Fields("ID2")
    rsQRYTOP.FindFirst ("Athlete = '" & Replace(rsAllAthletes.Fields("Athlete"), "'", "''") & "'")
    rsJUNCTION.Fields("AthleteID") = rsQRYTOP.Fields("AthleteID")
    rsAllAthletes.MoveNext
    rsJUNCTION.Update
    Loop

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Running query while tables linked (Access 2003)

    You haven't told us what problems occur.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Running query while tables linked (Access 2003)

    Sorry Hans, I should have looked at the error number/notice it was bringing up. Basically my events were in the wrong order on other queries, and I was trying to fill a junction table with only 1 half (table) existing. So it was unable to create a Junction table having only one side. Your reply made me take another look at the error it was causing. Thanks for comming in, have a good weekend.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •