Hi I have the following code and am trying to pass the value contained in STRScoloumdetail(1) to the FindNext criteria. It works fine if I hard code to value but when using the variable i just get the unknown function name. Any help would be greatly appreciated.
Cheers Mick
Private Sub Apply_Timing_Click()
Dim RScoloumdetail As DAO.Recordset
Dim FRScoloumdetail As DAO.Recordset
Dim STRScoloumdetail As DAO.Recordset
Dim CalDate As Variable
Dim CountRecords As Integer
Dim CountFormRecords As Integer
Dim StartTime As Variant
Dim REFKEYFIND As Variant
Dim DurationAdd As Variant
Set STRScoloumdetail = CurrentDb.OpenRecordset("Select * FROM [tbl start_Time]") ' Table that contains 1 entry only which is the start time
REFKEYFIND = Forms![frm Agenda Maintenance].[REFKEY MASTER]
Set RScoloumdetail = CurrentDb.OpenRecordset("Select * FROM [tbl MASTER DATA] WHERE [REFKEY MASTER] = '" & REFKEYFIND & "' ORDER BY MASTERSORT ASC") ' Needs to be changes to "Running_Order" whe time permits
RScoloumdetail.MoveFirst
StartTime = STRScoloumdetail(1) ' this contains the start time from the table start time
Set FRScoloumdetail = CurrentDb.OpenRecordset("Select * From [24_Hour_Clock]")
'''' I JUST NEED TO PASS THE VALUE FROM "STRScoloumdetail(1)" TO THE FINDNEXT SEARCH
FRScoloumdetail.FindNext "[12Hour] = 8.30" 'this works fine but i need to use the STRScoloumdetail(1) value for the find criteria
FRScoloumdetail.FindNext "[12Hour] = STRScoloumdetail(1)" ' i get unknown function name
RScoloumdetail.Edit
RScoloumdetail(5) = FRScoloumdetail(1)
RScoloumdetail.Update
''''''''''''''''''''''''''''''
'Fill remaing results
Do
DurationAdd = RScoloumdetail(4)
FRScoloumdetail.Move [DurationAdd]
RScoloumdetail.MoveNext
RScoloumdetail.Edit
RScoloumdetail(5) = FRScoloumdetail(1)
RScoloumdetail.Update
Loop
End Sub