title: How to loop through each value of a specific column in Access
body: <p>I have a table with following information:</p>
  
  <pre><code>Destination        Currency Rate    Minutes     Amount Country
  Pakistan           Mobile Uphone    USD 0.0150  12,500.00       
  pakistan           Fixed Lahore     USD 0.0152  6,512.00        
  Pakistan           Uphone Onnet     USD 0.1542  15,612.00       
  India              Fixed Onnet      USD 0.1940  150,151.00      
  India              Mumbai           USD 0.7462  1,161.00        
  India              Mobile Reliance  USD 0.4798  16,431.00       
  India              Mobile BSNL      USD 0.3655  64,311.00       
  India              Bharti Mobile    USD 0.8450  43,434.00       
  India              Idea Mobile      USD 0.1252  646,146.00      
  </code></pre>
  
  <p>Using a form I am trying to find Country name in the country column. For this purpose I have a form with a button and the following code:</p>
  
  <pre><code>Private Sub cmdProceed_Click()
  
  'Delcare variables
  Dim db As DAO.Database
  Dim rst As DAO.Recordset
  Dim V1 As String
  Dim V2 As String
  
  
  'Initialize declared variables
  
  Set db = CurrentDb
  Set rst = db.OpenRecordset("FirstQuery")
  V1 = rst.OpenRecordset.Fields("Destination")
  V2 = "Pakistan"
  
  'Perform the following things
  
  rst.MoveFirst
  
  
  Do While Not rst.EOF
  
  rst.Edit
  
  If (InStr(1, V1, V2)) &gt; 0 Then
  
      rst.Fields("Country").Value = V2
  Else
      rst.Fields("Country").Value = Nothing
  End If
  
      rst.Update
      rst.MoveNext
  
  
  
  
  Loop
  
  rst.Close
  Set rst = Nothing
  
  Me.Refresh
  
  End Sub
  </code></pre>
  
  <p>When I run this code it will place "Pakistan" in "Country" column even against those records where text "Pakistan" does not exist. What I understand that my code is not changing value of Variable V1. Can anyone help me how can I get to a situation where if the text "Pakistan" exists in the "Destination" column, then value of "Country" column is equal to "Pakistan", else value of "Country" column is equal to nothing? </p>