View Single Post
  #7  
Old May 14th, 2010, 05:36 PM posted to microsoft.public.access.forms
mls via AccessMonster.com
external usenet poster
 
Posts: 46
Default how can I replace SQL query with VBA logic

Sample group TestNo
29045 IG Test 1
29053 IG Test 1
29053 IR Test 1
29067 IG Test 1
29067 IR Test 1

John, In the above table, I want to update Testno, only for the records which
has same sampleid and different group( 'IG') as 'Test 2'. TestNo for record
should not change.

Thanks
John W. Vinson wrote:
Tom, I fixed the syntax error.
If the sample appears twice in the list then only I have to execute my code
and change the TestNo. In order to capture the duplicate sampleid I am using
dcount function to count. I can't use the WHERE clause as my samples change
each and every time and I don't know what they will be.


You certainly do NOT need to know the sample number to find duplicates. Could
you explain the logic which identifies which records need to be updated? A
Query referencing the table should certainly be able to do this.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1