Tom Crowfoot
asked on
Option Explicit
Dear Experts,
I have recently run the performance analyser over the forms in my Access 2010 database and it suggested I add an option Explicit Statement to one of the forms. However in doing so it breaks one piece of code, I believe I need to declare all the variables, but I'm not sure how to do this on this piece of code:
Can anybody help?
I have recently run the performance analyser over the forms in my Access 2010 database and it suggested I add an option Explicit Statement to one of the forms. However in doing so it breaks one piece of code, I believe I need to declare all the variables, but I'm not sure how to do this on this piece of code:
Private Sub UpdateRecipients_Click()
Me.Recipients = ""
RecipientsList.BoundColumn = 3
For Each Item In RecipientsList.ItemsSelected
Recipients = Recipients + RecipientsList.ItemData(Item) + "; "
Next Item
Me.RecipientsVisual = ""
RecipientsList.BoundColumn = 2
For Each Item In RecipientsList.ItemsSelected
Me.RecipientsVisual = Me.RecipientsVisual + RecipientsList.ItemData(Item) + ", "
Next Item
End Sub
Can anybody help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
brilliant - Thank you very much
If using it breaks the code, it is because you have one or more undeclared variables. Access should show you your undeclared variables when you execute the code.