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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform: Can Someone Help?

Status
Not open for further replies.

Rjc8513

Technical User
Feb 12, 2001
140
US
Just not getting it. Is this even possible? Two suggestions so far have not helped. Here's the deal:

Main form [frm ARCHIVE] with record source [qry ARCHIVE].
Combo box [cbx UNIT] on the main form which (after update) creates a Recordset Clone and displays the selected unit's data in the subform [frm ARCHIVE SUBFORM] on the main form. The subform's record source is also the query [qry ARCHIVE]. It works fine up to this point.

Now the problem- I want to have two text boxes on the main form, [tbxBegDate] and [tbxEndDate] in which the user enters a desired date range. Then I want the data for the previously selected unit, for the selected date range, to appear in the subform.

Can this be done? Please, I'm a little dense, explain in detail what I should do. It seems as though this should be a fairly simple step but it's not sinking in. Thanks.

Richard...

 
Sounds like a simple process. We need to take some simple steps.

1. Create a Main Form with no RecordSource.
2. On this form put your combobox and your two text boxes.
3. Let the Rowsource of the combo box be the units from the Archive table.
4. Add a subform with the record source being all the units and any detail you may desire.
5. Create a query that has the same fields that will be on your subform. In the criteria for the units, put a reference to the ComboBox. In the criteria for the date use the Between...And statement referencing your TextBoxes.
6. Now let's add a control button on the Main Form. In the click event put...

Private Sub cmdButton_Click()
Me![MySubformNameHere].Form.RecordSource = "qry Archieve"
End Sub


This is the simple approach. Once you get this installed you can imbellish.


ljprodev@yahoo.com
ProDev, MS Access Applications B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top