Velocipedus
New member
- Local time
- Today, 06:58
- Joined
- Jul 23, 2015
- Messages
- 4
Depending on the value of "imagecount", this function should return a string of 1, 2, or 3 image URLs for the same book record, separated by a space.
I think the Select Case logic is OK,
but I think I need one more line so that the function actually returns a value. What is the magic word?
The function will be called in a query in this manner:
... (fImgURLs([image_count])) AS URL
Is the manner in which the [books_id] field is embedded in the statement the correct way to output the URL ?
I think the Select Case logic is OK,
but I think I need one more line so that the function actually returns a value. What is the magic word?
The function will be called in a query in this manner:
... (fImgURLs([image_count])) AS URL
Is the manner in which the [books_id] field is embedded in the statement the correct way to output the URL ?
Code:
Public Function fImgURLs(image_count As Integer) As String
Dim ImgURL As String
Select Case image_count
Case Is = "3"
ImgURL = "LINKREMOVED.com/images/books/" & "[books_id]" & ".jpg" & " " & "LINKREMOVED.com/images/books/" & "[books_id]" & "_2" & ".jpg" & " " & "LINKREMOVED.com/images/books/" & "[books_id]" & "_3" & ".jpg"
Case Is = "2"
ImgURL = "LINKREMOVED.com/images/books/" & "[books_id]" & ".jpg" & " " & "LINKREMOVED.com/images/books/" & "[books_id]" & "_2" & ".jpg"
Case Is = "1"
ImgURL = "LINKREMOVED.com/images/books/" & "[books_id]" & ".jpg"
Case Else
ImgURL = ""
End Select
End Function
Last edited: