User input into a query

J

Jon R. Johansen

Hi!

I'm working on a school project due tonight and I need help!

I'm making a database for booking rooms at a school. I need to show all time slots (1 hour interval) with existing bookings and possibility for booking free slots.

I want to create a form with a subform. In the main form I want to make a drop down menu where the user can choose from avaliable rooms. When he chooses a room I want that choice to be used in a query to look up the calendar for that room only and display the calendar in the subform.

My question is: How do I link the information on the form to the criteria of the query?

The access help text gives a detailed description on how to create the from, but only states that I should then "write the appropriate code to use the information in a query".

Any help is highly appreciated!

Jon Johansen
Oslo, Norway
 
M

[MVP] S.Clark

Since it's for homework... deposit 1M rubles into the trashcan on the corner. :D

Linking criteria from a form to a query can be accomplished using a Parameter.

e.g. WHERE SomeID = Forms!frmName!txtSomeID


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hi!

I'm working on a school project due tonight and I need help!

I'm making a database for booking rooms at a school. I need to show all time slots (1 hour interval) with existing bookings and possibility for booking free slots.

I want to create a form with a subform. In the main form I want to make a drop down menu where the user can choose from avaliable rooms. When he chooses a room I want that choice to be used in a query to look up the calendar for that room only and display the calendar in the subform.

My question is: How do I link the information on the form to the criteria of the query?

The access help text gives a detailed description on how to create the from, but only states that I should then "write the appropriate code to use the information in a query".

Any help is highly appreciated!

Jon Johansen
Oslo, Norway
 
J

Jon R. Johansen

AHHH!!!!

Thanks a LOT!

Jon
"[MVP] S.Clark" <[email protected]> skrev i melding Since it's for homework... deposit 1M rubles into the trashcan on the corner. :D

Linking criteria from a form to a query can be accomplished using a Parameter.

e.g. WHERE SomeID = Forms!frmName!txtSomeID


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hi!

I'm working on a school project due tonight and I need help!

I'm making a database for booking rooms at a school. I need to show all time slots (1 hour interval) with existing bookings and possibility for booking free slots.

I want to create a form with a subform. In the main form I want to make a drop down menu where the user can choose from avaliable rooms. When he chooses a room I want that choice to be used in a query to look up the calendar for that room only and display the calendar in the subform.

My question is: How do I link the information on the form to the criteria of the query?

The access help text gives a detailed description on how to create the from, but only states that I should then "write the appropriate code to use the information in a query".

Any help is highly appreciated!

Jon Johansen
Oslo, Norway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top