Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 01-27-2016, 03:52 AM   #1
niall_duggan96
Newly Registered User
 
Join Date: Jan 2016
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
niall_duggan96 is on a distinguished road
Angry How to refer to parameters in navigation forms in a query?

I'm having a problem with my database where a form is working perfectly okay but when I open it as a Subform in a navigation form I get errors.

On my database i have prevented double booking by using queries.

SELECT tbl_appointment.StartTime, tbl_appointment.EndTime
FROM tbl_appointment
WHERE (((tbl_appointment.ApptDate)=[Forms]![frm_appointment_new]![ApptDate]) AND ((tbl_appointment.StylistID)=[Forms]![frm_appointment_new]![StylistID]));

This is the SQL of my query.

The problem is when ever I click on my combobox start_time on my navigation form it comes up.

Enter Parameter value Forms!frm_appointment_new!apptdate

My navigation form is a 2 way navigation form with one button named appointments and the other named book.

Any help would be great.

niall_duggan96 is offline   Reply With Quote
Old 01-27-2016, 04:06 AM   #2
sneuberg
AWF VIP
 
Join Date: Oct 2014
Location: Tucson, Arizona
Posts: 3,506
Thanks: 362
Thanked 978 Times in 945 Posts
sneuberg will become famous soon enough sneuberg will become famous soon enough
Re: How to refer to parameters in navigation forms in a query?

A reference like [Forms]![frm_appointment_new]![ApptDate] needs to include the main form and subform. Check out:

http://access.mvps.org/access/forms/frm0031.htm
and
http://ss64.com/access/syntax-references.html
__________________
And now nothing will be restrained from them, which they have imagined to do. Genesis 11:6

Steve
sneuberg is offline   Reply With Quote
Old 01-27-2016, 07:24 AM   #3
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,581
Thanks: 68
Thanked 2,754 Times in 2,638 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: How to refer to parameters in navigation forms in a query?

you will have a hard time figuring this out, navigation form is really navigation pain.

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
niall_duggan96 (01-28-2016)
Old 01-27-2016, 07:44 AM   #4
Grumm
Newly Registered User
 
Join Date: Oct 2015
Location: On a planet in space
Posts: 293
Thanks: 23
Thanked 62 Times in 60 Posts
Grumm is on a distinguished road
Re: How to refer to parameters in navigation forms in a query?

If you really have time (like me) just make the navigation menu on each form (functions behind the buttons are of course public subs in a module). Worked for me. I also made sure that there was only one form open at any time. (you can get bugs if you don't... nobody wants bugs)
Grumm is offline   Reply With Quote
Old 01-28-2016, 09:30 AM   #5
niall_duggan96
Newly Registered User
 
Join Date: Jan 2016
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
niall_duggan96 is on a distinguished road
Re: How to refer to parameters in navigation forms in a query?

so would it be Forms![frm_navigation]![frm_appointment_new].Form!ApptDate?
niall_duggan96 is offline   Reply With Quote
Old 01-28-2016, 09:40 AM   #6
sneuberg
AWF VIP
 
Join Date: Oct 2014
Location: Tucson, Arizona
Posts: 3,506
Thanks: 362
Thanked 978 Times in 945 Posts
sneuberg will become famous soon enough sneuberg will become famous soon enough
Re: How to refer to parameters in navigation forms in a query?

That looks about right if the names are correct. Are you sure about [frm_navigation]. I thought Access named it [Navigation Form]?

__________________
And now nothing will be restrained from them, which they have imagined to do. Genesis 11:6

Steve
sneuberg is offline   Reply With Quote
Reply

Tags
navigation , parameter , prevent double booking , subforms

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Refer to Combobox on a subform within Navigation Form in a query parameters tanalea Forms 4 05-09-2016 01:37 AM
Use controls from separate forms as parameters in same query Sketchin Queries 3 03-28-2014 11:21 AM
[SOLVED] How to refer to parameters in navigation forms in a query? monfas Queries 5 05-20-2013 08:29 PM
How do I set query parameters from forms? neilxt Forms 2 06-19-2012 10:50 AM
[SOLVED] Using checkboxes on forms to modify query parameters bungy Queries 0 06-06-2006 03:00 AM




All times are GMT -8. The time now is 06:03 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World