I'm having some trouble with my code. I bolded and underlined the section in question. We do drug testing and I'm slowly trying to build a random generator form. I'm kind of a noob when it comes to VBA so be easy on me. TIA
Private Sub btnTest_Click()
Dim db As Database
Dim rsC As Recordset
Dim Cust As Long
StatusBox = ""
Cust = Forms!RandomF!CustomerCombo.Column(0)
Set db = CurrentDb
Set rsC = db.OpenRecordset("SELECT Rnd([DonorID]*Now()) AS X, DonorFirstName, DonorLastName, OrganizationID " _
& "FROM DonorT " _
& "WHERE OrganizationID='" & Cust & "'" ORDER BY X DESC)
While Not rsC.EOF
Status rsC!X & ":" & rsC!DonorFirstName & " " & rsC!DonorLastName
rsC.MoveNext
Wend
rsC.Close
db.Close
Set rsC = Nothing
Set db = Nothing
End Sub