how to add a query field to a form (1 Viewer)

Mark1982

Registered User.
Local time
Today, 08:44
Joined
Jul 12, 2018
Messages
37
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?)
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:44
Joined
May 7, 2009
Messages
19,229
Use dlookup:

=Dlookup("fieldtoreturn","[Annual Budget 2018]")
 

Mark1982

Registered User.
Local time
Today, 08:44
Joined
Jul 12, 2018
Messages
37
Dear Arnel,

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

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:44
Joined
May 7, 2009
Messages
19,229
Add a criteria:


=Dlookup("fieldtoreturn","[Annual Budget 2018]", "fieldname=" & combo)
 

Mark1982

Registered User.
Local time
Today, 08:44
Joined
Jul 12, 2018
Messages
37
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

Registered User.
Local time
Today, 08:44
Joined
Jul 12, 2018
Messages
37
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.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:44
Joined
May 7, 2009
Messages
19,229
There is no proponent or payroll code in the table.
 

Mark1982

Registered User.
Local time
Today, 08:44
Joined
Jul 12, 2018
Messages
37
Yes in previous there was no combo box but they told me to add. so i add it.
 

Mark1982

Registered User.
Local time
Today, 08:44
Joined
Jul 12, 2018
Messages
37
Dear Sir Arnel I send you my updated database in your email.
 

Users who are viewing this thread

Top Bottom