Hi all,
What I'm trying to do is two-fold. We'll tackle one and then the other, or whichever is easiest.
First Question/Problem:
Is it possible to write VBA code that would change a text box to a (let's say) list box based on the answer to a question? For example:
Second Question/Problem:
I know how to set a list box to enable mutliple selections, but what I don't know how to do is select only those names for either a report or another field. For example, let's say I have 10 customer names, but I only want a report for the 2 that I have highlighted. How would I go about doing that? Another example would be, let's say that I have 20 items of product listed in a list box and a customer buys 5 items. I've figured out how to highlight those 5 items, but not how to move those items into another field that shows what that customer has purchased.
I've heard about array variables, and I have a basic idea of what they do, but I'm still confused about how to actually implement them. Is this a situation where an array variable would solve my problem or am I still wandering around, lost in the woods?
What I'm trying to do is two-fold. We'll tackle one and then the other, or whichever is easiest.
First Question/Problem:
Is it possible to write VBA code that would change a text box to a (let's say) list box based on the answer to a question? For example:
Code:
Dim Answer As Integer
Answer = MsgBox("Would you like to make multiple selections?", & _
vbCrLf & "vbYesNo + vbQuestion, "Record Selection")
If Answer = vbYes Then
' Code to change text box to list box where list box contains all
' customer names
Else
' Set focus to the text box in question
Me.CustomerName.SetFocus
End If
I know how to set a list box to enable mutliple selections, but what I don't know how to do is select only those names for either a report or another field. For example, let's say I have 10 customer names, but I only want a report for the 2 that I have highlighted. How would I go about doing that? Another example would be, let's say that I have 20 items of product listed in a list box and a customer buys 5 items. I've figured out how to highlight those 5 items, but not how to move those items into another field that shows what that customer has purchased.
I've heard about array variables, and I have a basic idea of what they do, but I'm still confused about how to actually implement them. Is this a situation where an array variable would solve my problem or am I still wandering around, lost in the woods?
Comment