Displaying a recordset as a normal query

harrisw

Registered User.
Local time
Today, 16:48
Joined
Mar 27, 2001
Messages
131
Having trouble with trying to display the details inside a recordset

I have the code below

Set rsset = dbase.OpenRecordset("SELECT * FROM [qrySalesAreaList] WHERE [Sales Area] ='" & _
txtSalesArea & "'")

The query works but I want to be able to diplay the results in a normal access query view.
 
The simplest way is to create a query based on qrySalesAreaList, referencing the text box on the form as follows (using the correct form name):

qrySelectedArea:-
SELECT * FROM [qrySalesAreaList] WHERE [Sales Area] = forms![formName]!txtSalesArea


Then run the query from the On Click event of a command button on the same form with the OpenQuery method:-

DoCmd.OpenQuery "qrySelectedArea", acNormal, acEdit
 
The sql bit is already driven from a list box which has the txtsalesarea in column 0

Is there a way that this can display after the user double clicks the list box.
 
Forms have a RecordSet Property that you can set.

Set up the form with the fields that you want. Open it and set the Recordset property equal to your Recordset object.

Note: This method does not work for Reports as they do not have a RecordSet Property.
 
Still not what I want to achieve.

I have a form with a list box on it when the list box is double clicked the sales area that is clicked in the list box will form part of the recordset /sql statement and then diplay a query in table form on the screen. The user can then print/email/export to excel etc from the query list on the screen
 

Users who are viewing this thread

Back
Top Bottom