Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basing a Recordset on a Filtered Continuous form

Status
Not open for further replies.

JamesBBB

Technical User
Nov 2, 2005
74
0
0
GB
Hi All

This is a little difficult to explain. The object of the excerise is to allow a user to display anumber of records on a continuous form and each of these records contain a filename.

After the user has filtered out just the records they need on the form (via Filters) then they would copy the files to a remote location.

So Basically the records on view on the continuous form would constitute a recordset.

On the button, I am trying to assign the recordset, but am hopelessly lost, any guidance would be gratefully received.

The code(if you can call it that) I am trying to use is as follows:-


Example one: (Does not work)

Dim rst1 As Recordset
Set rst1 = Me.Recordset

While Not rst.EOF

aax = rst![Author] ' Get record from recordset
MsgBox aax
rst.MoveNext
Wend
rst.Close

**************************************

Example Two:(does not work either)

Dim rstTitles As ADODB.Recordset
Set rstTitles = Me.Recordset
rst.Open "rsttitles", CurrentProject.Connection, adOpenDynamic, adLockOptimistic, adCmdTable

While Not rst.EOF

aax = rst![Author] ' Get record from recordset
MsgBox aax
rst.MoveNext
Wend
rst.Close

***************************************

Dim rst As Recordset, criteria As String

Set rst = Me.RecordsetClone

'rst.Open "rsttitles", CurrentProject.Connection, adOpenDynamic, adLockOptimistic, adCmdTable

While Not rst.EOF

aax = rst![Author] ' Get record from recordset
MsgBox aax
rst.MoveNext
Wend
rst.Close




Any help would be great as I really dont know what IM doing wrong

Many thanks

James
 
Have you referenced the Microsoft DAO x.x Object Library? If so, you can use DAO, which is easier.

[Code typed, not tested]
Dim rs As DAO.Recordset

Set rs=Me.RecordsetClone

Do While Not rs.EOF

MsgBox rs!Author

rs.Movenext
Loop[/code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top