A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Default text box as query filter



 
 
Thread Tools Display Modes
  #1  
Old October 23rd, 2009, 05:14 PM posted to microsoft.public.access.forms
Claire
external usenet poster
 
Posts: 132
Default Default text box as query filter

I have unbound text boxes on a form header that have default values. The
query on which this form is based is filtered according to these values.
Right now, when I open the form it asks for these values as parameters.

Is there a way to automate access to use the default value for a text box as
the parameters or to open/load the header before the rest of the form so that
the defaults are already loaded? Would it be better to assign these values
as an on load event instead of as defaults?

Thank you for any suggestions you have!

~Claire
  #2  
Old October 23rd, 2009, 08:47 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Default text box as query filter

I'm pretty sure that a DefaultValue will work. I know an assigned value will
work.

In the criteria box, right-click and choose "Build" The navigate to the
textbox on your form.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Claire" wrote in message
...
I have unbound text boxes on a form header that have default values. The
query on which this form is based is filtered according to these values.
Right now, when I open the form it asks for these values as parameters.

Is there a way to automate access to use the default value for a text box
as
the parameters or to open/load the header before the rest of the form so
that
the defaults are already loaded? Would it be better to assign these
values
as an on load event instead of as defaults?

Thank you for any suggestions you have!

~Claire



  #3  
Old October 26th, 2009, 08:06 PM posted to microsoft.public.access.forms
Claire
external usenet poster
 
Posts: 132
Default Default text box as query filter

I have entered the form's text box as the criteria for the query. However,
because the text box does not have its default values before the form runs
the query, the query asks for the text box values as parameters. I have
tried to set the values 'On Open', but it's still too late for the query.
Any other ideas? I'm thinking I'll have to pull this criteria on a separate
form, though I'd rather not.

~Claire

"Arvin Meyer [MVP]" wrote:

I'm pretty sure that a DefaultValue will work. I know an assigned value will
work.

In the criteria box, right-click and choose "Build" The navigate to the
textbox on your form.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Claire" wrote in message
...
I have unbound text boxes on a form header that have default values. The
query on which this form is based is filtered according to these values.
Right now, when I open the form it asks for these values as parameters.

Is there a way to automate access to use the default value for a text box
as
the parameters or to open/load the header before the rest of the form so
that
the defaults are already loaded? Would it be better to assign these
values
as an on load event instead of as defaults?

Thank you for any suggestions you have!

~Claire



.

  #4  
Old October 28th, 2009, 05:47 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Default text box as query filter

If the text box is empty when the form opens. The query should not ask for
the value, it should return blank. If it is asking it means that you more
than likely have the syntax in the criteria incorrect. It should be in the
form of:

[Forms]![YourFormName]![YourTextBoxName]

If you are still having problems, assign the recordsource of the form in the
form's Open event, like:

Private Sub Form_Open()
Me.RecordSource = "QueryName"
End Sub

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Claire" wrote in message
...
I have entered the form's text box as the criteria for the query. However,
because the text box does not have its default values before the form runs
the query, the query asks for the text box values as parameters. I have
tried to set the values 'On Open', but it's still too late for the query.
Any other ideas? I'm thinking I'll have to pull this criteria on a
separate
form, though I'd rather not.

~Claire

"Arvin Meyer [MVP]" wrote:

I'm pretty sure that a DefaultValue will work. I know an assigned value
will
work.

In the criteria box, right-click and choose "Build" The navigate to the
textbox on your form.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Claire" wrote in message
...
I have unbound text boxes on a form header that have default values.
The
query on which this form is based is filtered according to these
values.
Right now, when I open the form it asks for these values as parameters.

Is there a way to automate access to use the default value for a text
box
as
the parameters or to open/load the header before the rest of the form
so
that
the defaults are already loaded? Would it be better to assign these
values
as an on load event instead of as defaults?

Thank you for any suggestions you have!

~Claire



.



  #5  
Old October 28th, 2009, 09:40 PM posted to microsoft.public.access.forms
Claire
external usenet poster
 
Posts: 132
Default Default text box as query filter

Thank you for your help! I thought I had put it in just that way before, but
apparently not. Everything is working just fine now as I added a me.requery
to the OnOpen Event.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.