Why doesn´t this code work?
Private Sub cmdSok_Click()
Dim sql As String
skivnr = 0
sql = "SELECT Titel FROM Skiva WHERE Snr = '" & Val(txtsnr.Text) & "'"
Data1.Refresh
Data1.RecordSource = sql
With Data1.Recordset
Do While Not .EOF
.FindFirst (sql)
If .NoMatch Then
MsgBox ("Ingen träff!"
Exit Do
Else
List1.AddItem !Titel
.MoveNext
End If
Loop
End With
End Sub
The run-time compiler/debugger says: "Syntax error in expression"
Grateful for tek-tips
/Perra
Private Sub cmdSok_Click()
Dim sql As String
skivnr = 0
sql = "SELECT Titel FROM Skiva WHERE Snr = '" & Val(txtsnr.Text) & "'"
Data1.Refresh
Data1.RecordSource = sql
With Data1.Recordset
Do While Not .EOF
.FindFirst (sql)
If .NoMatch Then
MsgBox ("Ingen träff!"
Exit Do
Else
List1.AddItem !Titel
.MoveNext
End If
Loop
End With
End Sub
The run-time compiler/debugger says: "Syntax error in expression"
Grateful for tek-tips
/Perra