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

Form Based Query Doesn't Work When Loaded From Parent

Status
Not open for further replies.

jontout

Technical User
Dec 29, 2006
95
GB
I've got a form called frmReport which has 2 date textboxes which are used as search critera within a query.
Code:
WHERE (((tblClaims.RecDate) Between [Forms]![frmReport]![txtManRepStart] And [Forms]![frmReport]![txtManRepEnd])

This query works fine when I launch frmReport as a standalone form, however frmReport will be opened from a 'parent' for using the command Form_frmReport.Visible = True via a command button.
My problem is that when I open the form this way and complete the date textboxes, that the query then runs 2 input boxes to have me enter the date critera a second time before working.

Is there a reason behind this, and if so how would I ensure that the criteria is passed correctly?
I've tried changing the form properties to MODAL and POPUP but that's not made a difference, so I'm going to carry on tweaking but I'd like a bit of advice while I'm doing so.

Cheers,

Jon
 
Strangely, I've answered my own question ;)
Code:
stDocName = "frmReport"
DoCmd.OpenForm stDocName, , , stLinkCriteria
seems to do the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top