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

View records in subform using filter.

Status
Not open for further replies.

HGoodloe

Programmer
Sep 4, 2008
53
US
I have a main form that includes a text box for entering a contract number.

Once that number has been entered, I need the records associated with that number to appear in the subform. The problem I'm faced with, I'm not quite sure of the correct syntax to used to apply a filter to the subform.

The following is the source code I attempted use but with no luck:

DoCmd.ApplyFilter , [ContractNO] = "tblcontract"

contractNO is the text box on the main form and tblcontract is the subform.

Other associated fields in the subform that needs to appear when contract number is entered are: DesNo, LettingDate and section.

I'm still Kinda new at all this and hope to have everything down pact at least by summer. This stuff is a totally different ball game from what I learned in school. I'm in the real world now, lol...

I do really appreciate you all's help thus far.



 
You do not need code to do this. Simply link the textbox to the subform using the Master Child properties of the subform control. Why not use a combobox instead to ensure that the user does not enter a bad contract number?

link master fields: [txtBoxYourTextBox]
link child fields: [contractNumber]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top