Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-11-2018, 10:52 PM   #1
Mark1982
Newly Registered User
 
Join Date: Jul 2018
Posts: 37
Thanks: 11
Thanked 1 Time in 1 Post
Mark1982 is on a distinguished road
how to add a query field to a form

I Cant Add add the query field to a form. i am doing it by control source.
=([Query]![Annual Budget 2018])

its giving me error of (#Name?)

Mark1982 is offline   Reply With Quote
Old 08-12-2018, 12:43 AM   #2
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 6,348
Thanks: 54
Thanked 2,029 Times in 1,942 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: how to add a query field to a form

Use dlookup:

=Dlookup("fieldtoreturn","[Annual Budget 2018]")
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 08-12-2018, 12:49 AM   #3
Mark1982
Newly Registered User
 
Join Date: Jul 2018
Posts: 37
Thanks: 11
Thanked 1 Time in 1 Post
Mark1982 is on a distinguished road
Re: how to add a query field to a form

Dear Arnel,

But my field is in Combo Box. and i want it dsum in my form.

Mark1982 is offline   Reply With Quote
Old 08-12-2018, 12:56 AM   #4
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 6,348
Thanks: 54
Thanked 2,029 Times in 1,942 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: how to add a query field to a form

Add a criteria:


=Dlookup("fieldtoreturn","[Annual Budget 2018]", "fieldname=" & combo)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 08-12-2018, 12:58 AM   #5
Mark1982
Newly Registered User
 
Join Date: Jul 2018
Posts: 37
Thanks: 11
Thanked 1 Time in 1 Post
Mark1982 is on a distinguished road
Re: how to add a query field to a form

My Combo Box name is Cost Control and the combo box have two fields:
1.By Proponent
2.By Payroll

i want to create a d sum for each one by annual budget 2018.
Mark1982 is offline   Reply With Quote
Old 08-12-2018, 01:16 AM   #6
Mark1982
Newly Registered User
 
Join Date: Jul 2018
Posts: 37
Thanks: 11
Thanked 1 Time in 1 Post
Mark1982 is on a distinguished road
Re: how to add a query field to a form

Dear Arnel,
I try it not working.

Please see the below:

table name is: Budget 33101
Field in the Table:
1:Expense Code
2:Annual Budget 2018
3:Cost Control (which is combobox) have two fields 1.By Proponent 2.By Payrol)

now i want to make dsum for each field of combo box to show me total of annul budget 2018.
Mark1982 is offline   Reply With Quote
Old 08-12-2018, 01:19 AM   #7
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 6,348
Thanks: 54
Thanked 2,029 Times in 1,942 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: how to add a query field to a form

There is no proponent or payroll code in the table.

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 08-12-2018, 01:22 AM   #8
Mark1982
Newly Registered User
 
Join Date: Jul 2018
Posts: 37
Thanks: 11
Thanked 1 Time in 1 Post
Mark1982 is on a distinguished road
Re: how to add a query field to a form

Yes in previous there was no combo box but they told me to add. so i add it.
Mark1982 is offline   Reply With Quote
Old 08-12-2018, 01:33 AM   #9
Mark1982
Newly Registered User
 
Join Date: Jul 2018
Posts: 37
Thanks: 11
Thanked 1 Time in 1 Post
Mark1982 is on a distinguished road
Re: how to add a query field to a form

Dear Sir Arnel I send you my updated database in your email.

Mark1982 is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Put value from query in form field, no result and flickering field bruceblack Forms 17 04-03-2018 09:53 AM
if query criteria, looking at form field return a null then look at field in table @stan Queries 16 06-11-2013 08:50 PM
how do I update form field from Query field bignan Forms 12 09-08-2008 06:07 AM
Field Names from form in Query Field titles samonwalkabout Queries 5 01-12-2004 09:41 AM
link query field to form field? DaniBoy General 5 08-15-2002 08:39 PM




All times are GMT -8. The time now is 04:57 PM.


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

Sponsored Links

How to advertise

Media Kit


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