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!

dialog box 1

Status
Not open for further replies.

Sundance

MIS
May 25, 1999
16
US
I am trying to use a dialog box created in forms!<br>
<br>
I call this form from my main form, but I wan the dialog box to comeup first, but the query displays from date and to date, not the dialog box I created, maybe I am not chaining it correctly, I have been using the example Northwind, Report Sales by Year, when you select it a dialog box pops up and you are able to select the two dates, I have made my changes just like the Query Sales by Year which is called by the Report, and I have created by Dialog box just like the dialog box. the only difference is I use a form to display information based up on the Query selecting between dates, only my dialog box comes up after the selection has already been performed. Help Me! please<br>
<br>
Thanks<br>
<br>
Sundance
 
Right:<br>
<br>
You have a form (form A), based upon a query you have written.<br>
When you open form A, by clicking a button on another form (form B), you want a dialogue box which you have created (as form C) to open first and get the criteria for form A.<br>
<br>
So:<br>
<br>
In the open event of form A, you need code which will open form C (the dialogue) using the line<br>
<br>
DoCmd.OpenForm "form C", , , , , acDialog<br>
<br>
which will open your dialogue box and in addition will stop the opening of the form go any further until the dialogue form is closed or hidden.<br>
<br>
When the user has entered their data in the dialogue, and clicked OK, the form is hidden, which passes control back to form A. Form A then checks that the form is still open, and if it is then carries on. It gets its data from the query it is based on, which in turn uses the data entered on the dialogue form as criteria.<br>
<br>
When form A is closed, it also closes the dialogue form (using the close event of form A).<br>
<br>
It sounds to me like you are doing one of the following:<br>
<br>
- Attempting to open the dialogue form in the load event of form a.<br>
- Mistyping the criteria in your query<br>
<br>
Does this help? If it doesn't, post the SQL you are using for your query and I'll have a look at it.<br>
<br>
Jonathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top