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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Execute query from textbox input



 
 
Thread Tools Display Modes
  #1  
Old March 21st, 2008, 01:05 AM posted to microsoft.public.access.queries
dboollu
external usenet poster
 
Posts: 10
Default Execute query from textbox input

I have a form which has a query made up of a few other queries (this may be
an incorrect thing to do) as the Record Source.

It has a three textboxes on the form in which I need each one to perform a
specific query associated with that textbox. In other words, the user types
in a number, presses 'Enter' or 'Tab' key, then the query (maybe needs
another mechanism) associated with that entered number will execute, and it
will display the relevant results in the form. This is the reason I used a
query containing the need queries as the form Record Source, so I could bind
each textbox where the results from the executed query will populate.

I have done this with a CustomerName combo box at the top of the form, but
not with a textbox. I can not link this CustomerName to the rest of the
form, because there will be many products (first textbox) etc associated with
this specific customer. And my employer does not want drop downs for these
other values that the user will manually enter.

I have tried using the After Update, On Exit, On Lost Focus event properties
with no luck. I'm sure one of these is the answer, but I am not getting it.
Also, I am not a great VBA programmer.
  #2  
Old March 21st, 2008, 08:25 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default Execute query from textbox input

Take a look at:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

(BTW, using a query as the RecordSource for a form is not necessarily a bad
thing.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"dboollu" wrote in message
...
I have a form which has a query made up of a few other queries (this may be
an incorrect thing to do) as the Record Source.

It has a three textboxes on the form in which I need each one to perform a
specific query associated with that textbox. In other words, the user
types
in a number, presses 'Enter' or 'Tab' key, then the query (maybe needs
another mechanism) associated with that entered number will execute, and
it
will display the relevant results in the form. This is the reason I used a
query containing the need queries as the form Record Source, so I could
bind
each textbox where the results from the executed query will populate.

I have done this with a CustomerName combo box at the top of the form, but
not with a textbox. I can not link this CustomerName to the rest of the
form, because there will be many products (first textbox) etc associated
with
this specific customer. And my employer does not want drop downs for
these
other values that the user will manually enter.

I have tried using the After Update, On Exit, On Lost Focus event
properties
with no luck. I'm sure one of these is the answer, but I am not getting
it.
Also, I am not a great VBA programmer.


  #3  
Old March 21st, 2008, 07:20 PM posted to microsoft.public.access.queries
dboollu
external usenet poster
 
Posts: 10
Default Execute query from textbox input

Hi Allen,

Thank you for your reply and the invaluable website!! I will definitely
utilize it in the future. I guess I neglected to state that the user doesn't
want to use any type of pushbutton to execute the search as it would just be
too easy! They want to enter a value, press either enter or tab, and have
the required info (from one table) fill in the blanks.

Can you suggest anything for that?

"Allen Browne" wrote:

Take a look at:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

(BTW, using a query as the RecordSource for a form is not necessarily a bad
thing.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"dboollu" wrote in message
...
I have a form which has a query made up of a few other queries (this may be
an incorrect thing to do) as the Record Source.

It has a three textboxes on the form in which I need each one to perform a
specific query associated with that textbox. In other words, the user
types
in a number, presses 'Enter' or 'Tab' key, then the query (maybe needs
another mechanism) associated with that entered number will execute, and
it
will display the relevant results in the form. This is the reason I used a
query containing the need queries as the form Record Source, so I could
bind
each textbox where the results from the executed query will populate.

I have done this with a CustomerName combo box at the top of the form, but
not with a textbox. I can not link this CustomerName to the rest of the
form, because there will be many products (first textbox) etc associated
with
this specific customer. And my employer does not want drop downs for
these
other values that the user will manually enter.

I have tried using the After Update, On Exit, On Lost Focus event
properties
with no luck. I'm sure one of these is the answer, but I am not getting
it.
Also, I am not a great VBA programmer.



  #4  
Old March 21st, 2008, 08:23 PM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default Execute query from textbox input

So you will execute the search in the AfterUpdate event procedure of the
text box.

You will still need to work on *what* to execute. The example will help.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"dboollu" wrote in message
...
Hi Allen,

Thank you for your reply and the invaluable website!! I will definitely
utilize it in the future. I guess I neglected to state that the user
doesn't
want to use any type of pushbutton to execute the search as it would just
be
too easy! They want to enter a value, press either enter or tab, and have
the required info (from one table) fill in the blanks.

Can you suggest anything for that?

"Allen Browne" wrote:

Take a look at:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

(BTW, using a query as the RecordSource for a form is not necessarily a
bad
thing.)

"dboollu" wrote in message
...
I have a form which has a query made up of a few other queries (this may
be
an incorrect thing to do) as the Record Source.

It has a three textboxes on the form in which I need each one to
perform a
specific query associated with that textbox. In other words, the user
types
in a number, presses 'Enter' or 'Tab' key, then the query (maybe needs
another mechanism) associated with that entered number will execute,
and
it
will display the relevant results in the form. This is the reason I
used a
query containing the need queries as the form Record Source, so I could
bind
each textbox where the results from the executed query will populate.

I have done this with a CustomerName combo box at the top of the form,
but
not with a textbox. I can not link this CustomerName to the rest of
the
form, because there will be many products (first textbox) etc
associated
with
this specific customer. And my employer does not want drop downs for
these
other values that the user will manually enter.

I have tried using the After Update, On Exit, On Lost Focus event
properties
with no luck. I'm sure one of these is the answer, but I am not
getting
it.
Also, I am not a great VBA programmer.


 




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 12:38 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.