dbTalk Databases Forums  

Perform query with data out of loaded form

comp.database.ms-access comp.database.ms-access


Discuss Perform query with data out of loaded form in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Oswald
 
Posts: n/a

Default Perform query with data out of loaded form - 02-07-2004 , 03:34 PM






Hey,

I have a table printers and a table pc's. I have a many to many
relationship, so I made an extra table printerpc.

I now have a form that gives info about a printer. I want to open a new
window that show all the pc's this printer is installed on.

How do I do this? When I make a query, I can type a hard coded value. For
instance show all pc's where printerid equals pr1. But I want the printerid
in the query to be the id of the printer currently showed in the loaded
form.

Hope this makes any sense...

Any help is welcome,
Oswald



Reply With Quote
  #2  
Old   
Ira Solomon
 
Posts: n/a

Default Re: Perform query with data out of loaded form - 02-07-2004 , 04:58 PM






Oswald:
Easy.
Assume your form is named printerform.
Assume the field on the form is named printerid.

In the query, in the criteria box for the printer put:

forms!printerform!printerid.

That will do it.

Note:

The form must open when you run the query!!!!!
If your form or field has spaces in the name then:
forms![printer form]![printer id]

Some people always use the [] even if they don't need it.

Good Luck
Ira Solomon

On Sat, 7 Feb 2004 22:34:23 +0100, "Oswald" <fluffster71 (AT) hotmail (DOT) com>
wrote:

Quote:
Hey,

I have a table printers and a table pc's. I have a many to many
relationship, so I made an extra table printerpc.

I now have a form that gives info about a printer. I want to open a new
window that show all the pc's this printer is installed on.

How do I do this? When I make a query, I can type a hard coded value. For
instance show all pc's where printerid equals pr1. But I want the printerid
in the query to be the id of the printer currently showed in the loaded
form.

Hope this makes any sense...

Any help is welcome,
Oswald



Reply With Quote
  #3  
Old   
Oswald
 
Posts: n/a

Default Re: Perform query with data out of loaded form - 02-08-2004 , 04:08 AM



Hello,

thank you very much, it works now!

Oswald

"Ira Solomon" <isolomon (AT) solomonltd (DOT) com> wrote

Quote:
Oswald:
Easy.
Assume your form is named printerform.
Assume the field on the form is named printerid.

In the query, in the criteria box for the printer put:

forms!printerform!printerid.

That will do it.

Note:

The form must open when you run the query!!!!!
If your form or field has spaces in the name then:
forms![printer form]![printer id]

Some people always use the [] even if they don't need it.

Good Luck
Ira Solomon

On Sat, 7 Feb 2004 22:34:23 +0100, "Oswald" <fluffster71 (AT) hotmail (DOT) com
wrote:

Hey,

I have a table printers and a table pc's. I have a many to many
relationship, so I made an extra table printerpc.

I now have a form that gives info about a printer. I want to open a new
window that show all the pc's this printer is installed on.

How do I do this? When I make a query, I can type a hard coded value. For
instance show all pc's where printerid equals pr1. But I want the
printerid
in the query to be the id of the printer currently showed in the loaded
form.

Hope this makes any sense...

Any help is welcome,
Oswald





Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.