Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2002
    Posts
    9

    Unanswered: Calcualted field on Form 2000 Select Statement

    Hi,
    This is my 1st ever post to this forumn

    I have written a simple database to catalogue my music collection.
    I decided to include a summary part of the form where i use the COUNT statement.

    However I cant get this to work as the control source in a text box. The query works fine, but if i simply copy and past the code into the Control source box i just get NAME#?

    SQL Query :-
    SELECT Count([Albums].[Album]) AS [counter]
    FROM Albums
    WHERE (((Albums.[Media Format])="C"));

    I can use a simple count but as soon as use the SELECT statement it all falls apart.

    Can anyone please help and explain why I have this problem

    Thanks
    Rob

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    I think that what you need to do is reference the counter field in the query for your controlsource of the textbox. And don't forget to set the RecordSource of the form to that same query name ..

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    jmrSudbury has the better method ... I keep forgetting about the intrinsic functions ...

  4. #4
    Join Date
    Aug 2002
    Posts
    9
    Originally posted by M Owen
    jmrSudbury has the better method ... I keep forgetting about the intrinsic functions ...
    Thanks JmrSudbury and M.Owen the Domain fuction works fine and now I can happily work away.

    For my scenerio, could I have only used my other query if I had created a sub form ???

    Thanks again
    Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •