Why does access keep asking me to enter parameters? (1 Viewer)

Kiz

Registered User.
Local time
Today, 17:41
Joined
Nov 12, 2014
Messages
11
Hi all,

I am very very new to access, i have built a database with a query that has a couple of calculations, they seem fine in the datasheet view, but i keep getting asked to enter a parameter value. I have attached my access file to have a look at.

Thank you in advance!
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 17:41
Joined
Jan 20, 2009
Messages
12,849
You will have to zip your database before you can attach as you don't have enough posts yet.

The paramater may be due to you changing the name of fields in the table. Such changes are not automatically propogated to the OrderBy property of the query.
 

Kiz

Registered User.
Local time
Today, 17:41
Joined
Nov 12, 2014
Messages
11
Thank you for that, has this attachment worked?

I had a look at the names, they seem right to me... So confused! :confused:
 

Attachments

  • CPS Dummy System.accdb
    736 KB · Views: 97

Galaxiom

Super Moderator
Staff member
Local time
Today, 17:41
Joined
Jan 20, 2009
Messages
12,849
A calculation in a query cannot refer to an aliased field name. Use the original field name.

I would also suggest you rethink your names. Avoid spaces and special characters in all names.

Also read up about database normalization.

You need to use more relational design principles too. You have repeating groups of fields such as addresses that should be in another table.

BTW Do you know what the First function actually does? It is rarely what new developers expect. Usually they need Min rather than First. Likewise Max rather than Last.
 

Kiz

Registered User.
Local time
Today, 17:41
Joined
Nov 12, 2014
Messages
11
Thanks for your suggestions, so I guess it is very obvious I am new at this! ;)

I will definitely work on the other suggestions re: naming and normalization... however, in regards to my original query, I can't see any aliased field name. What I have done is 3 calculated query fields (Payable Commission on Turnover, Payable Commission On Service Fee, Payable Commission On Discount) then an additional calculated query called "Payable Commission" that calculates the total of those 3 fields.

Can I even do that?? :confused::confused:
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 17:41
Joined
Jan 20, 2009
Messages
12,849
What I have done is 3 calculated query fields (Payable Commission on Turnover, Payable Commission On Service Fee, Payable Commission On Discount) then an additional calculated query called "Payable Commission" that calculates the total of those 3 fields.

Exactly. You have derived a field then used it in a further calculation.

You cannot do this in the same level of a query. You must either repeat the original calculations or do them in a subquery.

Any field referred to must be directly available in corresponding From clause.
 

Users who are viewing this thread

Top Bottom