Results 1 to 2 of 2
  1. #1
    niki09 is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    10

    Thumbs up #name? error using a form based on a crosstab query

    I have a form showing a result (an amount) from a cross tab query. The form is to present weekly totals, preferably for each of the last 26 weeks.
    201601 $200
    201602 $250
    201603 $102
    ..
    201612 $75
    etc

    The week number comes from a formula in the query based on the transaction date (eg 201601 is the total of transactions in week 1 2016).

    I hope the form can present rolling weekly totals.

    The initial form had the fields 201601 201602 to 201613 etc and was fine.
    When I progressed to the next week, 201614 was now a field to report, but it was not in the form (as it was not in the cross tab when the form was written).

    I thought a work around could be to create fields in the form to cover the next (say) 26 weeks, then when I run the form, it will show the value for 201613 and 201614 when I reach those weeks (and it does do this).
    So I added fields in the form for
    201614


    201615
    201616
    etc

    However, as I now have fields in the form (i.e. future weeks) that do not exist in the cross tab, those fields get the #name? error when the form is run.
    I understand that access is saying that the field does not exist (true), but is there a work around? I tried iif with iserror, ismissing etc, but still the same.

    Thanks

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Crosstabs don't make for good queries when the number of distinct rows is dynamic because as you probably have figured out, CT fields that don't exist in the source throw an error. I don't get why you're not using a more compatible/traditional form/subform datasheet configuration. Why not have a datasheet below a main/top level data section?

    I can only think of one scenario that would be an exception (i.e. where something like a dynamic crosstab is required) and that is if you HAD to have a delimited list that needed to be transposed into rows).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 09-03-2015, 11:31 AM
  2. Replies: 2
    Last Post: 06-09-2012, 07:59 AM
  3. Report based on crosstab query
    By pbuecken in forum Reports
    Replies: 7
    Last Post: 01-16-2012, 09:59 PM
  4. Replies: 1
    Last Post: 09-05-2010, 11:28 AM
  5. Replies: 1
    Last Post: 07-30-2010, 10:28 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums