Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Putting fields onto one line in a report (2003)

    Is it possible to place the details of a second circuit on the same line as the first circuit , therefore putting all the information onto one line.
    This would only occur if the circuit field = 2.

  2. #2
    Star Lounger
    Join Date
    Sep 2002
    Location
    Hastings, Sussex, England
    Posts
    67
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Putting fields onto one line in a report (2003)

    I can't think of a way to do this in a query without getting very complicated using two recordsets from the same table. You could try grouping options and a calculated field that concatenates both values, setting a criteria of circuit field = 1 to avoid duplicates, but this only works if you will never have a circuit field value of 2 without a corresponding 1.

    However, If I was approaching this problem, I'd use some code to run through the records, concatenating data where appropriate, and outputting the data to a temporary table.

    Just some thoughts,

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Putting fields onto one line in a report (2003)

    Interesting question but why would you want to do it anyway? How do you handle if you have many items that meet your item 2 requirement? Trying to put them all on one line may make it very hard to read or may force you to use Memo fields.

    What is it you are actually trying to do?
    Regards,

    Gary
    (It's been a while!)

  4. #4
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Putting fields onto one line in a report (2003)

    Can you tell me what code l would need to use in order to run through the records, concatenating data where appropriate, and outputting the data to a temporary table.
    I am beginner when it comes to VBA and therefore will need some help. When the temporary table is created l assume l could then display all the data in the same row?

  5. #5
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Putting fields onto one line in a report (2003)

    I am trying to put all the data onto one line for reporting purposes. This is what the client requires.
    Do you think what l am trying to do is beyond the realms of Access?
    I have no idea as to how l could approach this problem. Any help would be appreciate.

  6. #6
    Star Lounger
    Join Date
    Sep 2002
    Location
    Hastings, Sussex, England
    Posts
    67
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Putting fields onto one line in a report (2003)

    You are fighting against MS Access' normal way of working. You may even need to look at your data structure to see if it is optimum for your system - if the data will not easily come out in the format you require, there may be something fundamentally wrong with how the data is being stored.

    Putting that aside, here's how I would approach the problem.

    I like to use arrays when concatenating data; it makes the data easier to handle. For the current task, a single-dimension array is probably appropriate.

    I don

  7. #7
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Putting fields onto one line in a report (2003)

    Thanks for your help and feedback, do you have a simple example as a semi-complex example is going to confuse me, as l am only a beginner when it comes to coding.

  8. #8
    Star Lounger
    Join Date
    Sep 2002
    Location
    Hastings, Sussex, England
    Posts
    67
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Putting fields onto one line in a report (2003)

    Sorry, no simple example. I've stripped out some redundant comments from the code in the attached file (and changed table names). Try following the code using my previous post as a guide. Think of it as a useful learning exercise!

    JulesG

Posting Permissions

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