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!

Using an additional condition in a subform

Status
Not open for further replies.

ken2834

Technical User
Jun 26, 2006
27
US
I am writing a small Access application that pulls in data relating to a financial trade. Each trade has two records (rows) associated with it -- there is a "pay" side and a "receive" side to the trade. I query the recordset by trade number. I wanted to simultaneous show selected fields from both sides of the trade, so I created two subforms within a form, but I am having problems trying to apply different conditions to each of the subforms so they will show different sides of the trade. How can I do this?
Maybe I need another approach entirely?
 
Since you always have 2 rows for each record, is it not possible to simply put that all into one row? Then for your subforms or whatever else, have 2 separate queries that pull the data you need for each instance? That way, you can still divide up the data into whatever presentation you prefer while still having only one "row" for each "record"; or I guess it would be more correct to say to have one "record" for each main item of interest.

But, if there is a specific reason you need the 2 rows, then use that method, by all means. Just based on the information given, I would guess that would help (putting it all in one "row" in your table design.
 
Ken, we need to see what you tried already?

Common approach, after Trade Number, is selected from main form,
you can either manipulate the recordsource of each subform,
or the filter property.

Private Sub cboTradeNumber_AfterUpdate()
Me.sfrmPay.Form.Recordsource = _
"SELECT * FROM tblPay WHERE fkTradeNumber =" & _
Me!txtTRadeNumber

Me.sfrmReceive.Form.Recordsource = _
"SELECT * FROM tblReceive WHERE fkTradeNumber =" & _
Me!txtTRadeNumber
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top