How shall I write the code so i get surname first and forenamn last

Set rs = db.OpenRecordset("SELECT * FROM tblData WHERE Surename & Forename LIKE '"& "'" & "& '*'")

i don't know if this is right

Recommended Answers

All 5 Replies

SELECT Surename , Forename FROM tblData

it don't work get error

post your code..

Private Function list()
If rs.RecordCount = 0 Then
errormsg = MsgBox(" Inga poster hittades", , "TelefonBoken")
Exit Function
Else
If Len(TxtSearch.Text) > 0 Then
TxtSearch.Text = Mid(TxtSearch.Text, 1, Len(TxtSearch.Text) - 1)
Else
rs.MoveLast
rs.MoveFirst
max = rs.RecordCount
rs.MoveFirst
Lstdata.Clear
For i = 1 To max
Lstdata.AddItem rs("eftn") ' and I will have forename to


rs.MoveNext
Next i
End If
End If

End Function

This code doesn't even include the select statement, debasisdas has already solved this really...Post the code with this select statement included.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.