Hi,
I also have a SQL question:
Dim conn As ADODB.Connection
Dim rst As New ADODB.Recordset
Set conn = CurrentProject.Connection
Dim curArtist As String
rst.Open "SELECT Artist FROM Artist_Information WHERE Artist = " & curArtist, conn, adOpenForwardOnly, adLockReadOnly
--> Here I get a syntax error (missing Operator) for 'Artist='
Why is that?
The code goes on:
While Not rst.EOF
curArtist = rst.Fields(0)
If curArtist = "Anna Ternheim" Then
MsgBox ("Biography: Anna Ternheim was born in 1976" )
End If
rst.MoveNext
Wend
Thanks!
I also have a SQL question:
Dim conn As ADODB.Connection
Dim rst As New ADODB.Recordset
Set conn = CurrentProject.Connection
Dim curArtist As String
rst.Open "SELECT Artist FROM Artist_Information WHERE Artist = " & curArtist, conn, adOpenForwardOnly, adLockReadOnly
--> Here I get a syntax error (missing Operator) for 'Artist='
Why is that?
The code goes on:
While Not rst.EOF
curArtist = rst.Fields(0)
If curArtist = "Anna Ternheim" Then
MsgBox ("Biography: Anna Ternheim was born in 1976" )
End If
rst.MoveNext
Wend
Thanks!