Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.
Note that the GetName at the end is trying to put return just the ClientName field for the recordset rsResult. But I'm not sure how to get it to do that. This doesn't work - it tells me that the item isn't in the collection. I've also tried GetName = rsResult.ClientName, but that doesn't work either, because it's not an object.
Private Function GetName (Client) Dim strSQL as String Dim rsResult as Recordset Dim DB as Database strSQL = "SELECT TOP 1 ClientID, ClientName, FROM tblClients " & _ "WHERE (ClientID = " & Client & ");" Set DB = CurrentDb Set rsResult = DB.OpenRecordset(strSQL) GetName = rsResult([ClientName]) End Function
Join the community of 500,000 technology professionals and ask your questions.