hey guys, i've been working on this bit of code all day! Im trying to take the ID from a selected item on a listbox and use it to open a report where the ID equals the ID in the table. I hope that makes sense. Anyway here is the code:
Dim varItem as Variant
Dim currentRow as Integer
For currentRow = 0 to Me.ListJobcards.ListCount - 1
If Me.ListJobcards.Selected(currentRow) Then
varItem = Me.ListJobcards.ItemData(currentRow)
End If
Next currentRow
DoCmd.OpenReport "cash sale", acViewReport, ,"Jobcard.[ID] = " & varItem
When i call the method i get an inputbox telling me to enter 'Jobcard.ID'. Im assuming it has something to do with the formatting of the where statement. Please help. Much appreciated.