By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,124 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,124 IT Pros & Developers. It's quick & easy.

Sending date to query problem

P: n/a
I have a number of queries, running one after the other, which do quite a
complex calculation. A text box on a form provides the date for this routine.

I have another routine I wish to do and it happens that the final query in the
above routine contains the data I need. However I don`t want to fire this
routine from the same form as before.

I could make copies and rename the queries I suppose but is there a way I could
enter the date in a new form, maybe open the original form, minimised ? send the
date to that text box then run the routine ?

Hope that makes sense. Suspect there is a simple way to do this but I`m missing
it

David B
Hexham UK

Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Perhaps you could run your first set of queries from a button on a different
form than your date form. The first line of code would be:
DoCmd.OpenForm "NameOfForm ToEnterDate",,,,,acDialog

<Code to run queries>

DoCmd.OpenForm "NameOfSecondForm"
DoCmd.Close acForm, "NameOfFirstForm"

<Code to run other routine>

DoCmd.Close acForm, "NameOfForm ToEnterDate"
DoCmd.Close acForm, "NameOfFirstForm"

In the Date form, you would need the following code in the AfterUpdate event of
the Date textbox:
Me.Visible = False
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c0**********@news5.svr.pol.co.uk...
I have a number of queries, running one after the other, which do quite a
complex calculation. A text box on a form provides the date for this routine.

I have another routine I wish to do and it happens that the final query in the
above routine contains the data I need. However I don`t want to fire this
routine from the same form as before.

I could make copies and rename the queries I suppose but is there a way I could enter the date in a new form, maybe open the original form, minimised ? send the date to that text box then run the routine ?

Hope that makes sense. Suspect there is a simple way to do this but I`m missing it

David B
Hexham UK

Nov 12 '05 #2

P: n/a
That should work. effectively call a popup form to enter the date
Thanks
DB

PC Datasheet <sp**@nospam.spam> wrote in message
news:I0*****************@newsread3.news.atl.earthl ink.net...
Perhaps you could run your first set of queries from a button on a different
form than your date form. The first line of code would be:
DoCmd.OpenForm "NameOfForm ToEnterDate",,,,,acDialog

<Code to run queries>

DoCmd.OpenForm "NameOfSecondForm"
DoCmd.Close acForm, "NameOfFirstForm"

<Code to run other routine>

DoCmd.Close acForm, "NameOfForm ToEnterDate"
DoCmd.Close acForm, "NameOfFirstForm"

In the Date form, you would need the following code in the AfterUpdate event of the Date textbox:
Me.Visible = False
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c0**********@news5.svr.pol.co.uk...
I have a number of queries, running one after the other, which do quite a
complex calculation. A text box on a form provides the date for this routine.
I have another routine I wish to do and it happens that the final query in the above routine contains the data I need. However I don`t want to fire this
routine from the same form as before.

I could make copies and rename the queries I suppose but is there a way I

could
enter the date in a new form, maybe open the original form, minimised ? send

the
date to that text box then run the routine ?

Hope that makes sense. Suspect there is a simple way to do this but I`m

missing
it

David B
Hexham UK



Nov 12 '05 #3

P: n/a
What do you mean by "routine"? If you are trying to use the same reports,
then how does it matter that it comes from a new form? The results will be
the same unless you are changing the queries in the reports somehow.

Mike Storr
www.veraccess.com
"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c0**********@news5.svr.pol.co.uk...
I have a number of queries, running one after the other, which do quite a
complex calculation. A text box on a form provides the date for this routine.
I have another routine I wish to do and it happens that the final query in the above routine contains the data I need. However I don`t want to fire this
routine from the same form as before.

I could make copies and rename the queries I suppose but is there a way I could enter the date in a new form, maybe open the original form, minimised ? send the date to that text box then run the routine ?

Hope that makes sense. Suspect there is a simple way to do this but I`m missing it

David B
Hexham UK

Nov 12 '05 #4

P: n/a
I want to display the data differently on a different form and in a different
part of my app.
David

Mike Storr <no****@somewhere.con> wrote in message
news:pW********************@news20.bellglobal.com. ..
What do you mean by "routine"? If you are trying to use the same reports,
then how does it matter that it comes from a new form? The results will be
the same unless you are changing the queries in the reports somehow.

Mike Storr
www.veraccess.com
"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c0**********@news5.svr.pol.co.uk...
I have a number of queries, running one after the other, which do quite a
complex calculation. A text box on a form provides the date for this

routine.

I have another routine I wish to do and it happens that the final query in

the
above routine contains the data I need. However I don`t want to fire this
routine from the same form as before.

I could make copies and rename the queries I suppose but is there a way I

could
enter the date in a new form, maybe open the original form, minimised ?

send the
date to that text box then run the routine ?

Hope that makes sense. Suspect there is a simple way to do this but I`m

missing
it

David B
Hexham UK



Nov 12 '05 #5

P: n/a
Yes, and the key to it working is to make the popup form not visible so the date
is available to the second form.

Good luck!

Steve
PC Datasheet

"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c0**********@newsg3.svr.pol.co.uk...
That should work. effectively call a popup form to enter the date
Thanks
DB

PC Datasheet <sp**@nospam.spam> wrote in message
news:I0*****************@newsread3.news.atl.earthl ink.net...
Perhaps you could run your first set of queries from a button on a different
form than your date form. The first line of code would be:
DoCmd.OpenForm "NameOfForm ToEnterDate",,,,,acDialog

<Code to run queries>

DoCmd.OpenForm "NameOfSecondForm"
DoCmd.Close acForm, "NameOfFirstForm"

<Code to run other routine>

DoCmd.Close acForm, "NameOfForm ToEnterDate"
DoCmd.Close acForm, "NameOfFirstForm"

In the Date form, you would need the following code in the AfterUpdate event

of
the Date textbox:
Me.Visible = False
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c0**********@news5.svr.pol.co.uk...
I have a number of queries, running one after the other, which do quite a
complex calculation. A text box on a form provides the date for this routine.
I have another routine I wish to do and it happens that the final query in the above routine contains the data I need. However I don`t want to fire this
routine from the same form as before.

I could make copies and rename the queries I suppose but is there a way I

could
enter the date in a new form, maybe open the original form, minimised ?
send the
date to that text box then run the routine ?

Hope that makes sense. Suspect there is a simple way to do this but I`m

missing
it

David B
Hexham UK


Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.