I have a bit of a problem. My form has a ListBox that gets populated with a result of a query. Sometimes the query returns a zero-string so the value in a my listbox become just a blank (In all other cases it is a numeric value). That does not look proffesional. What I want is to populate my list box with a numeric zero (0)insted of having the listbox show a blank. This is my code:
Thanks in advance!
Code:
Private Sub GoToNxt_Click()
On Error GoTo Err_GoToNxt_Click
DoCmd.GoToRecord , , acNext
strSQL2 = " SELECT Count([0006 In Bin and Not Counted].[TID#]) AS [CountOfTID#]" & _
" FROM [0006 In Bin and Not Counted]" & _
" GROUP BY [0006 In Bin and Not Counted].Cust, [0006 In Bin and Not Counted].Comment" & _
" HAVING [0006 In Bin and Not Counted].Comment Like 'Inter*' " & _
" AND [0006 In Bin and Not Counted].Cust = " & Me.Cust.Value & ";"
[b] If Len(strSQL2) > 0 Then
List100.RowSource = strSQL2
Else
List100.RowSourceType = "Value List"
List100.RowSource = 0
End If
[/b]
Exit_GoToNxt_Click:
Exit Sub
Err_GoToNxt_Click:
MsgBox Err.Description
Resume Exit_GoToNxt_Click
End Sub
Thanks in advance!