Results 1 to 5 of 5
  1. #1
    Simone is offline Novice
    Windows XP Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    3

    datasheet form with dates in new columns

    I need to make a simple datasheet form based on 2 fields "Company name" and "Inspection date". There are multiple inspection dates for each company which are entered in an Inspection form.




    The datasheet form should be as follows:
    Column1 is company name - column2 is first inspection date - column3 is 2nd inspection date etc for up to 7 dates.


    However I cannot get the dates to go into separate columns. I end up with a new row for each new inspection date. How can I get the "Inspection date" field to put the dates into separate columns?


    Thanks in advance for your help.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you shouldnt, that is not good database design.
    it should be:
    [co], [inspection date]
    co Name, date1
    co Name, date2
    co Name, date3

  3. #3
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    If you want this spreadsheet style output create a crosstab query from your table OR use Excel
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  4. #4
    Simone is offline Novice
    Windows XP Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    3
    Thanks for your replies

    Since it is bad database design, I really just need this information displayed in a report. Is it possible to create a report whereby the "inspection date" field lists the dates in multiple columns whereby "inspection date 1" is the earliest and "inspection date 4" is the most recent inspection?
    Like this:
    [co], [inspection date 1], [inspection date 2], [inspection date 3], [inspection date 4]

  5. #5
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    You could try formatting the control that contains the date to display the data in columns. In design view, select the control, Ribbon > page setup > Columns. You will have to make sure it's only 1 row in height, and set the Can Grow property to No. Variations in the count of dates would mean your columns don't line up with any header labels you might be using. See below for more on that when considering a ct query as well.

    Or try basing the report on a cross tab query that was mentioned previously. One problem you could encounter there is that the number of fields in a ct query can change from one time to another. So if you have 7 dates the 1st time and 5 the next, you'll get 7 then 5 date fields. Specifically setting the number of fields in the query might solve that, but why complicate things? Would dates in rows in a report be so bad? It might just come down to how you design the report.
    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: 6
    Last Post: 02-23-2016, 01:45 PM
  2. Replies: 3
    Last Post: 11-03-2015, 11:19 PM
  3. Programatically Add Columns to a Datasheet
    By altemir in forum Forms
    Replies: 2
    Last Post: 03-27-2012, 10:02 AM
  4. Replies: 1
    Last Post: 05-23-2011, 07:11 AM
  5. Generate datasheet columns on the fly?
    By kman42 in forum Programming
    Replies: 0
    Last Post: 03-11-2011, 03:52 AM

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