Query Return Recordset As...

  • Thread starter Thread starter tbrogdon
  • Start date Start date
T

tbrogdon

Is it possible to run a query from a form and have the query return
its recordset in continuous form format rather than a datasheet?

Thanks,

Tim
 
Is it possible to run a query from a form and have the query return
its recordset in continuous form format rather than a datasheet?


That doesn't make sense to me, but you can set a form's
DefaulView to Continuous and use the query as its record
source. Then the form; will open using the query's data and
display it in continuous view.

I guess if you want to be tricky about it, you could open an
unbound continuous form. Then open a recordset on the query
and set the form's Recordset property.

Why don't you explain what goal you are shooting at? Maybe
then someone might be able to suggest a way to achieve it.
 
Why don't you explain what goal you are shooting at? Maybe
then someone might be able to suggest a way to achieve it.

Hi Marshall,

I have a parameter query (3 criteria) behind an unbound form that
returns a recordset of daily production.

The idea is that the production supervisors input their data
throughout the day and will need to be able to recall/review/edit
their data for the day - but not directly in datasheet view as there
are a substantial amount of fields and screen space is limited. I
*think* it will be more user-friendly if the returned recordset is not
in datasheet view.

Please let me know if there is, and I'm sure there is, a more elegant/
efficient way to do this than I am aware of.

As always - thank you very much for your help,

Tim
 
You could copy your existing form, rename it, remove all of the unrequired
fields and open it in datasheet view if you still want to do it that way and
then allow a user to double click on a row to open up the relevant record in
the original full standard form view, thats how i work my database and it
works well because datasheet view is the best way to find a record in my
opinion
 
You could copy your existing form, rename it, remove all of the unrequired
fields and open it in datasheet view if you still want to do it that way and
then allow a user to double click on a row to open up the relevant record in
the original full standard form view, thats how i work my database and it
works well because datasheet view is the best way to find a record in my
opinion

That sounds like it will do what I want but I'm not sure how to do it.

A little more info:

The query form (qryprodReview) asks for 3 criteria via
txtProductionDate, cboDept, and cboShift (these are a composite pk for
tblProduction which is linked to tblProductionOperation which is where
the details I want to edit are recorded).
The form also has a "Get Record" button which returns the recordset
(currently in datasheet view).

The records in tblproductionOperation are originally entered via
frmProductionOperation (which is the format I would like the user to
edit records in (single form view).

How can I functionally have the user double-click the record in
datasheet view and have it open an instance of frmProductionOperation
containing the data from the clicked record? Is that what you are
saying can be done?

Thanks again,

Tim
 
Hi Tim, provided the datasheet opened is an actual form, open the form in
design view and pick the field that you will want the user to double click on
in datasheet mode - it can be any field that you want. Howver you need to
make sure that the uniqueID that will bind the datasheet and your
frmproductionoperation is on both e.g. productionID? - right click on the
field you will use, properties, onblclick event and enter:

Dim stDocName As String
Dim stviewCriteria As String

stDocName = "frmproductionoperation"
stviewCriteria = "[productionD]=" & Me![productionID] 'change to PK
DoCmd.openform stDocName, , , stviewCriteria

However if the PK is 3 fields as you indicate then substitute the
stviewcriteria line to:

stLinkCriteria = "[date]=" & "'" & Me![date] & "'" _ 'change date to your
names
& "[dept]=" & "'" & Me![dept] & "'" _ 'change dept to your names
& "[shift]=" & "'" & Me![shift] & "'" 'change shift to your names

the first value is the name of the field on the form you want to open -
fromproductionoperation - the second value, me!fieldname is the name of the
field on the datasheet that you currently have open so substitute these
accordingly.

Rhys.
 
On Dec 12, 10:27 am, Rhys Davies
.......provided the datasheet opened is an actual form.....


Hi Rhys,

Your code makes perfect sense to me...Thanks...but....

The datasheet is an actual form...yet.

What I have is frmProdReview (that I described a little above) which
has 3 unbound fields that collect the criteria for a parameter query.
The form also has a command button (cmdGetMyRecord) that when clicked
returns the recordset as a standalone datasheet.

I've tried embedding frmProductionOperation into frmProdReview but am
uncertain as to how to tell cmdGetMyRecord to open the returned
recordset -into- the form - even as a datasheet. It always returns it
outside as a standalone.

I think I am missing something.........

Tim
 
Hi Rhys,

I've spent time reviewing our discussion and realize that you have
already answered my second question...Sorry...and Thanks again.

I'm in the process of putting it all together.

Tim
 
Back
Top