DAO: updating a field value by looping through another table

jostrep

Registered User.
Local time
Today, 20:46
Joined
May 19, 2002
Messages
30
I need some help here please.

I need to loop from a table (Markers), each record consist of the record number for the begining ,end and time value for some of the records. Ex: table Markers record 1 correspond to record 4 to 200 on the table FormatedData.

What it must do is loop through each records from table Markers to match the right time value to each records from the table FormatedData.

Code:
Sub MatchTimeValues()
'Declaring variables

Dim tv As Recordset 'Table contaning the time values and the begining/end markers
Dim fd As Recordset 'Table contaning the time values and the begining/end markers
Dim nv As Integer '
Dim srt As Integer
Dim nd As Integer
Dim tv As Double
      
Set db = CurrentDb()


Set tv = db.openrecordset("SELECT * FROM Markers")
nv = Numéro.Value
srt = StartMrk.Value
nd = EndMrk.Value
tv = TimeValue.Value
Set fd = db.openrecordset("SELECT * FROM FormatedData")
 
      
     
      
'Loop through the records from the First table
For Each rec In tv
    'Loop through the records of second table
    'Assing values according if the Numero.value is between Start and End
    If Numéro.value  => Start And =< End Then TimeValue = Time
    
    Do Until fd.EOF 'Loop through every record
    


Next rec


End Sub
 

Users who are viewing this thread

Back
Top Bottom