so i am reading a texfile where there are two different values. i have to read the file and split the values. as you can see my condition is " ". anyway i want to insert one of the values into a recordset. And in the recordset is testnumber alredy entered in the recordset. so i only have to add "strekkfasthet however i want to add "strekkfasthet" inn to the recordset. the two valuse must go together. how can i do that? i know it is some kind of an if sentence i have to use. but when i try "stdset!testnr" is stuck on the first recordvalue. plis help me!!!
Option Compare Database
Private Sub Command0_Click()
Dim filsti, linje As String
Dim filnr As Long
Dim tempArray() As String
Dim strsql As String
Dim stdset As DAO.Recordset
Dim testnr As Long
Dim strekkfasthet As Double
filsti = CurrentProject.Path & "\data.txt "
filnr = FreeFile
Open filsti For Input As #filnr
Do While Not EOF(filnr)
Line Input #filnr, linje
tempArray = Split(linje, " ")
MsgBox (tempArray(1))
strsql = " SELECT * FROM test"
Set stdset = CurrentDb.OpenRecordset(strsql)
If stdset!testnr = tempArray(0) Then
strsql = " DELETE testnr from test"
CurrentDb.Execute (strsql)
stdset.AddNew
stdset!testnr = tempArray(0)
stdset!strekkfasthet = tempArray(1)
stdset.Update
Else
Call MsgBox("the testnumber doesnt exist")
End If
Loop
Close #filnr
End Sub