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  

Hold it, we found SQL view....



 
 
Thread Tools Display Modes
  #1  
Old May 28th, 2004, 02:06 AM
1.156
external usenet poster
 
Posts: n/a
Default Hold it, we found SQL view....

Fred, we now can see the code -- don't know how we didn't run into it
earlier.

The SQL code looks understandable for the original simple query with no
drop down entry box.

So now if we could just get started with an UNBOUND form, we may start
making process. There seems to be nothing mentioning BOUND or UNBOUND
in all the form stuff we've seen so far.

Rob

fredg wrote:

On Wed, 19 May 2004 19:20:59 -0500, 1.156 wrote:



Fred, thanks again. That's a lot of stuff there. I'll see if I can
follow your instructions, and I'll let you know what happens.
Regards, Rob

fredg wrote:



On Wed, 19 May 2004 17:43:38 -0500, 1.156 wrote:





We've got a pretty useful database working but neither of us knows what
SQL means. We make queries using the graphics "design view". Please
let me ask if the following can be done:

In the query, the CRITERIA line reads :" Enter genome". The user has to
type in a genome and the query shows all the records with this genome in
the genome field. There is a table (not yet used) which has all the
genome possibilities. Naturally, some query users type in incorrect
genomes, not in the table. It sure would be nice to have a drop down
menu allowing the query user to select one of the genomes listed in the
genome table. Can this be done without writing SQL code?

Thanks for any help,




I hit the wrong tool button and inadvertently sent an incomplete
message.

1) When you use the QueryByExample ('graphics') grid to create a
query, Access writes the actual SQL code that really does the work. To
read the code, in Query Design View click on the Query View tool
button and select SQL.

2) You have the right idea to use the table to allow the user to
correctly select the genome wanted. Here's how. But first a question.
Does the table that contains the list of genomes have a Unique ID
field? It should. If so .....

You'll need to use a form to do this.

Make a new unbound form.
Add a combo box that will show the GenomeID field as well as the
GenomeText field.
Set the Combo Box Bound Column to 1
Set the Column Count to 2
Set the Column Widths property to 0";1"
Set the Auto Expand property to Yes.
Set the Limit to List property to Yes.
Name this combo box "cboSelector"

Add a command button to the form.
Code the button's Click event:
DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, Me.Name
Name this form "ParamForm"

Add the GenomeID field to the query grid.
Code the Query GenomeID field criteria line:
forms!ParamForm!cboSelector
(Instead of your current [Enter Genome] criteria. Do NOT use the
brackets. Access will correctly provide them.)

When you wish to run the query, first open the form.
Find the wanted Genome name in the combo box.
Click the command button.

The query will display just those records selected and the form will
close.






I read your in-between post, about having just a Genome and Researcher
field in that table.

You can get by just fine using just the Genome (as Text) field.
Instead of having the GenomeID and Genome fields in the combo box,
just use the Genome field. In which case, set the Column Count
property to 1, and the Column Width property to 1". Everything else
should be OK.
Good luck.



  #2  
Old May 28th, 2004, 02:57 AM
tina
external usenet poster
 
Posts: n/a
Default Hold it, we found SQL view....

don't mean to step on fred's toes, just stepping in because not everybody
keeps up with threads that've had no activity for a week or more. (i
probably wouldn't either, except i'm usually way behind on cleaning out my
flagged threads. g)
to answer your question re forms: a form is "bound" when there is a table,
query or SQL statement in the form's RecordSource property. if the
RecordSource property is blank, then the form is "unbound" - as in "not
bound to a recordset".

hth


"1.156" wrote in message
...
Fred, we now can see the code -- don't know how we didn't run into it
earlier.

The SQL code looks understandable for the original simple query with no
drop down entry box.

So now if we could just get started with an UNBOUND form, we may start
making process. There seems to be nothing mentioning BOUND or UNBOUND
in all the form stuff we've seen so far.

Rob

fredg wrote:

On Wed, 19 May 2004 19:20:59 -0500, 1.156 wrote:



Fred, thanks again. That's a lot of stuff there. I'll see if I can
follow your instructions, and I'll let you know what happens.
Regards, Rob

fredg wrote:



On Wed, 19 May 2004 17:43:38 -0500, 1.156 wrote:





We've got a pretty useful database working but neither of us knows

what
SQL means. We make queries using the graphics "design view". Please
let me ask if the following can be done:

In the query, the CRITERIA line reads :" Enter genome". The user has

to
type in a genome and the query shows all the records with this genome

in
the genome field. There is a table (not yet used) which has all the
genome possibilities. Naturally, some query users type in incorrect
genomes, not in the table. It sure would be nice to have a drop down
menu allowing the query user to select one of the genomes listed in

the
genome table. Can this be done without writing SQL code?

Thanks for any help,




I hit the wrong tool button and inadvertently sent an incomplete
message.

1) When you use the QueryByExample ('graphics') grid to create a
query, Access writes the actual SQL code that really does the work. To
read the code, in Query Design View click on the Query View tool
button and select SQL.

2) You have the right idea to use the table to allow the user to
correctly select the genome wanted. Here's how. But first a question.
Does the table that contains the list of genomes have a Unique ID
field? It should. If so .....

You'll need to use a form to do this.

Make a new unbound form.
Add a combo box that will show the GenomeID field as well as the
GenomeText field.
Set the Combo Box Bound Column to 1
Set the Column Count to 2
Set the Column Widths property to 0";1"
Set the Auto Expand property to Yes.
Set the Limit to List property to Yes.
Name this combo box "cboSelector"

Add a command button to the form.
Code the button's Click event:
DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, Me.Name
Name this form "ParamForm"

Add the GenomeID field to the query grid.
Code the Query GenomeID field criteria line:
forms!ParamForm!cboSelector
(Instead of your current [Enter Genome] criteria. Do NOT use the
brackets. Access will correctly provide them.)

When you wish to run the query, first open the form.
Find the wanted Genome name in the combo box.
Click the command button.

The query will display just those records selected and the form will
close.






I read your in-between post, about having just a Genome and Researcher
field in that table.

You can get by just fine using just the Genome (as Text) field.
Instead of having the GenomeID and Genome fields in the combo box,
just use the Genome field. In which case, set the Column Count
property to 1, and the Column Width property to 1". Everything else
should be OK.
Good luck.





  #3  
Old May 28th, 2004, 03:20 PM
1.156
external usenet poster
 
Posts: n/a
Default Hold it, we found SQL view....

Tina, thanks a lot. I believe this will help.
Rob

tina wrote:

don't mean to step on fred's toes, just stepping in because not everybody
keeps up with threads that've had no activity for a week or more. (i
probably wouldn't either, except i'm usually way behind on cleaning out my
flagged threads. g)
to answer your question re forms: a form is "bound" when there is a table,
query or SQL statement in the form's RecordSource property. if the
RecordSource property is blank, then the form is "unbound" - as in "not
bound to a recordset".

hth


"1.156" wrote in message
...


Fred, we now can see the code -- don't know how we didn't run into it
earlier.

The SQL code looks understandable for the original simple query with no
drop down entry box.

So now if we could just get started with an UNBOUND form, we may start
making process. There seems to be nothing mentioning BOUND or UNBOUND
in all the form stuff we've seen so far.

Rob

fredg wrote:



On Wed, 19 May 2004 19:20:59 -0500, 1.156 wrote:





Fred, thanks again. That's a lot of stuff there. I'll see if I can
follow your instructions, and I'll let you know what happens.
Regards, Rob

fredg wrote:





On Wed, 19 May 2004 17:43:38 -0500, 1.156 wrote:







We've got a pretty useful database working but neither of us knows


what


SQL means. We make queries using the graphics "design view". Please
let me ask if the following can be done:

In the query, the CRITERIA line reads :" Enter genome". The user has


to


type in a genome and the query shows all the records with this genome


in


the genome field. There is a table (not yet used) which has all the
genome possibilities. Naturally, some query users type in incorrect
genomes, not in the table. It sure would be nice to have a drop down
menu allowing the query user to select one of the genomes listed in


the


genome table. Can this be done without writing SQL code?

Thanks for any help,






I hit the wrong tool button and inadvertently sent an incomplete
message.

1) When you use the QueryByExample ('graphics') grid to create a
query, Access writes the actual SQL code that really does the work. To
read the code, in Query Design View click on the Query View tool
button and select SQL.

2) You have the right idea to use the table to allow the user to
correctly select the genome wanted. Here's how. But first a question.
Does the table that contains the list of genomes have a Unique ID
field? It should. If so .....

You'll need to use a form to do this.

Make a new unbound form.
Add a combo box that will show the GenomeID field as well as the
GenomeText field.
Set the Combo Box Bound Column to 1
Set the Column Count to 2
Set the Column Widths property to 0";1"
Set the Auto Expand property to Yes.
Set the Limit to List property to Yes.
Name this combo box "cboSelector"

Add a command button to the form.
Code the button's Click event:
DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, Me.Name
Name this form "ParamForm"

Add the GenomeID field to the query grid.
Code the Query GenomeID field criteria line:
forms!ParamForm!cboSelector
(Instead of your current [Enter Genome] criteria. Do NOT use the
brackets. Access will correctly provide them.)

When you wish to run the query, first open the form.
Find the wanted Genome name in the combo box.
Click the command button.

The query will display just those records selected and the form will
close.







I read your in-between post, about having just a Genome and Researcher
field in that table.

You can get by just fine using just the Genome (as Text) field.
Instead of having the GenomeID and Genome fields in the combo box,
just use the Genome field. In which case, set the Column Count
property to 1, and the Column Width property to 1". Everything else
should be OK.
Good luck.









 




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 05:23 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.