From: Patrick Hatton Patrick on 26 Mar 2010 08:07 I have a routine that uses data from a form. Each time I run it, it asks for input on any field contained in the form. If I open the form then manually run the query it works fine. When I let it run throught the code, it cannot see the fields. Your suggestions are greatly appreciated. Patrick
From: Marshall Barton on 26 Mar 2010 09:27 Patrick Hatton <Patrick Hatton(a)discussions.microsoft.com> wrote: >I have a routine that uses data from a form. Each time I run it, it asks for >input on any field contained in the form. > >If I open the form then manually run the query it works fine. When I let it >run throught the code, it cannot see the fields. We'll need to see the code that runs the query and the query to have a chance to figure out what might be wrong. At this point, all I can say is that when you run a query with form based parameters, the form MUST be open or you have to use a method that supplies the parameter values in the code. -- Marsh MVP [MS Access]
From: Daryl S on 26 Mar 2010 10:01 Patrick - Is the form open when you are trying to just run it through the code? If not, then open the form first. You can make the form inivisible if you don't want the users to see it. -- Daryl S "Patrick Hatton" wrote: > I have a routine that uses data from a form. Each time I run it, it asks for > input on any field contained in the form. > > If I open the form then manually run the query it works fine. When I let it > run throught the code, it cannot see the fields. > > Your suggestions are greatly appreciated. > > Patrick
From: Patrick Hatton on 26 Mar 2010 10:33 Yes, the form is open when running. The query is using: Between [forms]![frmreportform]![startmonth] And [forms]![frmreportform]![endmonth] This is the strange part. I can run the query with the form closed, no data. Open the form, run the query, works fine. When this same thing is done from the code, it doesn't work. "Daryl S" wrote: > Patrick - > > Is the form open when you are trying to just run it through the code? If > not, then open the form first. You can make the form inivisible if you don't > want the users to see it. > > -- > Daryl S > > > "Patrick Hatton" wrote: > > > I have a routine that uses data from a form. Each time I run it, it asks for > > input on any field contained in the form. > > > > If I open the form then manually run the query it works fine. When I let it > > run throught the code, it cannot see the fields. > > > > Your suggestions are greatly appreciated. > > > > Patrick
From: Patrick Hatton on 26 Mar 2010 10:36 not sure how to explain this. I have a large report with many subreports. The query that is bombing is part of a sub-report. The process requires the form in question to be open but still the data fields are not recognized. Between [forms]![frmreportform]![startmonth] And [forms]![frmreportform]![endmonth] "Marshall Barton" wrote: > Patrick Hatton <Patrick Hatton(a)discussions.microsoft.com> > wrote: > > >I have a routine that uses data from a form. Each time I run it, it asks for > >input on any field contained in the form. > > > >If I open the form then manually run the query it works fine. When I let it > >run throught the code, it cannot see the fields. > > We'll need to see the code that runs the query and the query > to have a chance to figure out what might be wrong. > > At this point, all I can say is that when you run a query > with form based parameters, the form MUST be open or you > have to use a method that supplies the parameter values in > the code. > > -- > Marsh > MVP [MS Access] > . >
|
Next
|
Last
Pages: 1 2 3 Prev: Hyperlinks in command button Next: Access 2010 Forms - Converting 2007 Client into 2010 Web |