[Main Category]
[Sub Category]
[SubForm with questions from sub category]
I was trying to change a shuffle script that I have used before to work here but have spent 3 hours and came up blank..
Expand|Select|Wrap|Line Numbers
- Private Sub Combo30_AfterUpdate()
- Dim MyDB As Database, MyRS As Recordset, intNoOfRecords As Integer
- Dim intRandomRecordNumber
- Set MyDB = CurrentDb
- Set MyRS = MyDB.OpenRecordset("Questions", dbOpenDynaset)
- MyRS.MoveLast
- intNoOfRecords = MyRS.RecordCount
- intRandomRecordNumber = Int(Rnd * intNoOfRecords)
- MyRS.AbsolutePosition = intRandomRecordNumber
- ' Dim rs As Object
- 'Set rs = Me.Recordset.Clone
- 'myRS.MoveFirst
- 'RS.MoveFirst
- 'Do Until MyRS.EOF
- 'rs.Edit
- 'rs.Fields("Question") = MyRS.Fields("Question")
- 'rs.Fields("Answer1") = MyRS.Fields("Answer1")
- 'rs.Fields("Answer2") = MyRS.Fields("Answer2")
- 'rs.Fields("Answer3") = MyRS.Fields("Answer3")
- 'rs.Fields("Topic") = MyRS.Fields("Topic")
- 'rs.Fields("Section") = MyRS.Fields("Section")
- 'rs.Update
- 'rs.MoveNext
- 'MyRS.MoveNext
- 'Loop
- rs.FindFirst "[Topic] = '" & Me![Combo30] & "'"
- If Not rs.EOF Then Me.Bookmark = rs.Bookmark
The first part is the shuffling of the questions.....the second part I was trying to figure out how to copy the contents of MyRS which is shuffled over RS. The last part just displays what is selected....Maybe I am TOTALLY off here. Any help would be great