RecordSet of Form

G

Guest

Is it possible to query the RecordSet of a form (ie, the data currently
displayed on it)?

I have a form based on 3 queries (the AfterUpdate event of a combobox
switches the recordsource of the form). The form displays the "one" side of a
"one to many" relationship.

Tables:

WorkOrder:

WorkOrderID (pk autonumber)
.....

WorksDetail:

WorkOrderID (fk)
SMV

In the form header, I would like a textbox that displays the Sum of the SMV
field for all those records currently displayed by the form (ie, all those
records that meet the forms query criteria). How can I do this?

Thanks,

Dave
 
J

jahoobob via AccessMonster.com

Place an unbound text box in the header of the form and set the Control
source to =Sum([SMV])
 
G

Guest

That won't work, since [SMV] is not on the form. The form only displays the
"one" side of the relationship. [SMV] is part of the "many" side.

Thanks for your input though,

Dave

jahoobob via AccessMonster.com said:
Place an unbound text box in the header of the form and set the Control
source to =Sum([SMV])
Is it possible to query the RecordSet of a form (ie, the data currently
displayed on it)?

I have a form based on 3 queries (the AfterUpdate event of a combobox
switches the recordsource of the form). The form displays the "one" side of a
"one to many" relationship.

Tables:

WorkOrder:

WorkOrderID (pk autonumber)
....

WorksDetail:

WorkOrderID (fk)
SMV

In the form header, I would like a textbox that displays the Sum of the SMV
field for all those records currently displayed by the form (ie, all those
records that meet the forms query criteria). How can I do this?

Thanks,

Dave
 
J

jahoobob via AccessMonster.com

Create a query that totals SMV. Create a form from this query with just this
total. Place the form as a subform on you main form. You can make the
subform look like a field.
That won't work, since [SMV] is not on the form. The form only displays the
"one" side of the relationship. [SMV] is part of the "many" side.

Thanks for your input though,

Dave
Place an unbound text box in the header of the form and set the Control
source to =Sum([SMV])
[quoted text clipped - 25 lines]
 
G

Guest

Good try again, but that still won't do it, since the records that I want a
total from change depending on certain query criteria selected from
comboboxes on the form, one of which changes the record source (ie the query
behind the form) dynamically. Hence why I need to be able query the query
behind the form so to speak.

jahoobob via AccessMonster.com said:
Create a query that totals SMV. Create a form from this query with just this
total. Place the form as a subform on you main form. You can make the
subform look like a field.
That won't work, since [SMV] is not on the form. The form only displays the
"one" side of the relationship. [SMV] is part of the "many" side.

Thanks for your input though,

Dave
Place an unbound text box in the header of the form and set the Control
source to =Sum([SMV])
[quoted text clipped - 25 lines]
 
J

jahoobob via AccessMonster.com

I assumed that you already had the total in a query. You have to place the
values from the combo boxes in the criteria of the query in which you get the
sum. If you get status of a, b, or c from a combo in the form frmMain called
Combo1, then in the criteria for Status in the query palce:
=[Forms]![frmMain]![Status]
Good try again, but that still won't do it, since the records that I want a
total from change depending on certain query criteria selected from
comboboxes on the form, one of which changes the record source (ie the query
behind the form) dynamically. Hence why I need to be able query the query
behind the form so to speak.
Create a query that totals SMV. Create a form from this query with just this
total. Place the form as a subform on you main form. You can make the
[quoted text clipped - 12 lines]
 

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