Picking a Winner via Access

  • Thread starter Thread starter Bunky
  • Start date Start date
B

Bunky

I have an application that determines who has had perfect attendance for the
prior week and emails these folks. Mgmt wants these people to be entered
into a drawing to win $$. So Person A has perfect attendance for week
1,4,7,and 8; they get 4 entries. Person B has perfect attendancee for week
1,2,3,4,5,6,7 and 9; they get 8 entries. What I want to happen is to tell
Access to pick a random number between 1 and 12 to determine the winner. I
was thinking of creating a one row table with the ID being Autonumber set to
random but it won't let me pick the range. Ideas would be most appreciated.
 
Ok, Mgmt changed to specs on me. Now when I generate the list of emails that
the certificate goes to, they want to be able to pick and chose who the email
goes to in the entire list. I got that working but how do I write just those
entries selected to a table for further processing?
Here is the code I am using to generate the email list. Please keep in mind
I am learning VB code OTJ.

Thanks for all the help!

Private Sub lstMailTo_Click()
Dim varItem As Variant
Dim strList As String

With Me!lstMailTo
If .MultiSelect = 0 Then
Me!txtSelected = .Value
Else
For Each varItem In .ItemsSelected
strList = strList & .Column(0, varItem) & ";"
Next varItem
If strList <> "" Then
strList = Left$(strList, Len(strList) - 1)
End If
Me!txtSelected = strList
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top