Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6839325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:42:19+00:00 2026-05-26T23:42:19+00:00

Here’s my problem: Let’s say I have these tables: table1 1 – a 2

  • 0

Here’s my problem:

Let’s say I have these tables:

table1

1 – “a”

2 – “b”

table2

1 –

2 –

3 –

Now, I’m using the following code to compare the tables:

table2.MoveFirst
Do While Not table2.EOF
 table1.Seek "=", table2!field2
  If table1.NoMatch Then
               go do a lot of things to find that information
  Else 
   table2.Edit
   table2!Field2 = table1!field2
   table2.update
  End If
 table2.MoveNext
Loop

But the line

table2!Field2 = table1!field2

Is not working so well. I’m pretty sure I’m doing something wrong here, but I’m having problems finding a solution. I’m not even sure what I should google…

EDIT: Field 2 is indexed in table 1, so the ‘seek’ works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:42:19+00:00Added an answer on May 26, 2026 at 11:42 pm

    A few notes.

    Let us say you want all the records from Table2 where there is no match on a field called Field1:

    sSQL = "SELECT Field1, FieldX FROM Table2 " _
         & "LEFT JOIN Table1 " _
         & "ON Table2.Field1 = Table1.Field1 " _
         & "WHERE Table1.Field1 Is Null"
    

    You could, of course, build the query in the query design window and fiddle around until is is just what you want, then switch to SQL view to get the right (ish) SQL string.

    Dim rs As DAO.Recordset
    
    Set rs = CurrentDB.Openrecordset(sSQL)
    
    ''table2.MoveFirst
    Do While Not rs.EOF ''table2.EOF
    
    ''You do not need no match, all these records are missing a match
    ''    table1.Seek "=", table2!field2
    ''    If table1.NoMatch Then
               go do a lot of things to find that information
        rs.MoveNext
    Loop
    ''This can all be done with one update query
    ''    Else 
    ''    table2.Edit
    ''    table2!Field2 = table1!field2
    ''    table2.update
    ''    End If
    ''    table2.MoveNext
    ''    Loop
    
    sSQL = "UPDATE Table2 " _
         & "INNER JOIN Table1 " _
         & "SET table2.Field2 = table1.field2 " 
    
    CurrentDB.Execute sSQL dbFailOnerror
    

    Please treat the above as notes, not finished code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code (Say we have a single button on the page that
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here's a coding problem for those that like this kind of thing. Let's see
Here is my problem : I have a post controller with the action create.
Here my problem: @Assert\Regex( * pattern=/^[A-Za-z0-9][A-Za-z0-9\]*$/, * groups={creation, creation_logged} * ) I'm using the
Here is my code...I have two dimensional matrices A,B. I want to develop the
Here is my code sample, let me know if it can be further improved?
Here an example of my checkbox list http://jsfiddle.net/YnM2f/ Let's say I check on G
Here's the problem....I have three components...A Page that contains a User Control and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.