Public Function VBINKORN(intab1 As String, uttab1 As String, NROO As Integer, ifra As String, sp As Integer) På första raden verkar du ha för få citationstecken, såhär vill du nog ha det istället:får syntaxfel i update vad gör jag för fel
Dim ska As String
Dim spoj1 As New Collection
Dim spoj2 As New Collection
Dim spoj3 As New Collection
Dim spoj4 As New Collection
Dim spoj5 As New Collection
Dim soi As Table
Dim a1 As Variant
Dim a2 As Variant
Dim a3 As Variant
Dim a4 As Variant
Dim a5 As Variant
Dim a6 As Variant
Dim dqt As Recordset
Dim db As Database
If SIGNALLA(NROO) = 1 Then
'ska = oTabortd(ugrtab)
Set db = CurrentDb
Set dk = db.CreateQueryDef("")
sql = "select " & intab1 & ".ind," & intab1 & ".fc_k," & intab1 & ".a1," & intab1 & ".fc," & intab1 & ".ant from " & intab1
Set tok = db.OpenRecordset(sql, dbOpenSnapshot)
While Not tok.EOF
If tok(1) <> Null Then a1 = tok(1) Else a1 = 0
If tok(2) <> Null Then a2 = tok(2) Else a2 = 0
If tok(3) <> Null Then a3 = tok(3) Else a3 = 0
If tok(4) <> Null Then a4 = tok(4) Else a3 = 0
tok.MoveNext
Wend
dk.sql = "update " & uttab1 & " set " & uttab1 & ".ind ="" & spejgan(0) & ""," & _
" set " & uttab1 & ".fc_k =" & a1 & "," & _
" set " & uttab1 & ".a1 =" & a2 & "," & _
" set " & uttab1 & ".fc =" & a3 & "," & _
" set " & uttab1 & ".ant =" & a4 & "," & _
" set " & uttab1 & ".signal =" & intab1 & "," & _
" set " & uttab1 & ".st =" & ifra & "," & _
" where (((" & uttab1 & ".signal)=""" & intab1 & """)) and ((" & uttab1 & ".st)=""" & ifra & """)"
dk.Execute
tok.Close
dk.Close
invasko(NROO) = 1
SIGNALLA(NROO) = 0
End If
End Function
OBS FUNKAR MED en satts
dk.sql = "update " & uttab1 & " set " & uttab1 & ".ind =""" & spejgan(0) & """ where (((" & uttab1 & ".signal)=""" & intab1 & """)) and (" & uttab1 & ".st)=""" & ifra & """"Sv: får syntaxfel i update vad gör jag för fel
dk.sql = "update " & uttab1 & " set " & uttab1 & ".ind =""" & spejgan(0) & """," & _
/Johan