Appending a Table from a Rnd Function

C

Chris

I have the code listed below. please see the line between
the *'s. Instead of the msgbox function I want to append a
table with the Random data. How do I do this?

Sub RandomList2()
Dim D As Database, R As Recordset, T As Recordset
Dim Top, Bottom
Set D = CurrentDb
Set R = D.OpenRecordset("tblLoans_reviewed")
Set T = D.Recordsets("tblLoans")
Randomize
R.MoveLast: R.MoveFirst 'gets the recordcount
Top = 0
Bottom = R.RecordCount - 1
R.Move Int((Top - Bottom + 1) * Rnd + Bottom)
****R![Loan_Number] Append to****
'MsgBox (R![Loan_Number]) & " " & (R!
[Application_User_Name])
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

Top