dr.cornwallis
Goto Top

Mittelwert aus anderer Query in Textfeld funktioniert nicht Access 2010

Liebe Gemeinde,

ich bräuchte wieder mal eure Hilfe:

ein Textfeld auf einem Formular zeigt mir die Anzahl der Mitarbeiter an, nun möchte ich noch den Mittelwert aus einer anderen Query in ein weiteres Textfeld einbauen, das klappt aber einfach nicht..

Textfeld 1: =Anzahl([Mitarbeiter])
Textfeld 2: =Mittelwert([qry_mittelwert120_150]![Stunden]) - verwende ich dieses Textfeld funktioniert das Textfeld 1 auch nicht mehr (#Fehler)

Was mache ich da falsch?
Ich kann leider die beiden Datensätze nicht in eine Query packen da ansonsten die Mitarbeiter doppelt vorhanden sind.

Danke!


Gruß

Dr.

Content-Key: 311844

Url: https://administrator.de/contentid/311844

Printed on: April 24, 2024 at 03:04 o'clock

Mitglied: 129813
Solution 129813 Aug 05, 2016 updated at 10:04:49 (UTC)
Goto Top
With VBA, this is done with
TextField2.Value = DAvg("Stunden", "qry_mittelwert120_150")
I think the AVG() Function does not work because the query is not executed in this context.

Regards
Member: Dr.Cornwallis
Dr.Cornwallis Aug 05, 2016 at 10:28:09 (UTC)
Goto Top
Thank you , it works, but now i got another Problem.. face-smile

I want to Count the employees from another Table(or Query), but there are multiple entrys, so the Value is not right(i want to Count every employee once)

My Textfield looks like this:

=DomAnzahl([Mitarbeiter];[qry_cluster150])

As Result i get a "#Name", do u know why? face-smile


Greets
Mitglied: 129813
Solution 129813 Aug 05, 2016 updated at 10:56:37 (UTC)
Goto Top
Zitat von @Dr.Cornwallis:
My Textfield looks like this:

=DomAnzahl([Mitarbeiter];[qry_cluster150])

As Result i get a "#Name", do u know why? face-smile
Because this parameters have to be strings not objects ;-P
=DomAnzahl("Mitarbeiter";"qry_cluster150")  
You should have a look into the documentation more often...