Results 1 to 4 of 4
  1. #1
    raffi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Inside a Sub Procedure
    Posts
    88

    Sub Report table which has Date only


    hello, i have been using access for 3 weeks now and finally i feel like im getting somewhere but unfortunately im having a slight problem

    as i have learned inserting sub reports into reports by merging Primary keys into the main table or junction table are very beneficial and the more tables there are the more ull be able to create sub reports and create filters right ?

    so what i did was i created a table only setting a Date Field and the primary key with its autonumber, and set that date fields default value =date() so it always shows present day, and then linked it to the main junction table so i can never type the wrong date, and also for later on i can search by date, not only by customer name, but its not working, in the conjunction table its giving me blank, is it because it is set default value =date() ? or dates cant have foreign keys ?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    I don't quite understand the purpose of the table, but the default value only determines what the value will be if you create a record. If you never create a record, there won't be a value there. From the sound of it, I'd use the default value of the date field in your main table, or the default value property of a textbox on your data entry form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    raffi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Inside a Sub Procedure
    Posts
    88
    im apologies for the misleading term a bit i explained wrong but i think i figured out what i needed if lets say the given situation is, i have a table, primary key Field name called DepartureDateID and its Data type Autonumber and under it field name again departureDate and next to it the datatype would be date/time and the default value of that field will be =date() , is there a way to generate autonumber automatically each day in the table ? if so it will also create a new date since there is =date() the default value, and i think it will be perfect.

    im doing this so, when ppl type in a date number in form, and click on the report, they would see what was that particular days all daily movements,

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Ah; I've never seen the point of a table like that. I just store dates (and it seems more intuitive for the user to type in a date). In any case, if you want to go that way, I'm not sure I'd bother trying to create a record every day. It would be fairly easy to run a bit of code that created the next x days in that table. You could create 5 days or 50000 in an instant.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. How create a table for a date range report
    By jegupta in forum Programming
    Replies: 12
    Last Post: 01-30-2014, 12:33 PM
  2. Replies: 3
    Last Post: 12-24-2013, 04:20 PM
  3. Replies: 3
    Last Post: 09-23-2013, 10:43 PM
  4. Date Range Report with Multiple Date Fields
    By StevenCV in forum Reports
    Replies: 13
    Last Post: 02-29-2012, 08:29 AM
  5. Link report date with a table field
    By lizzywu in forum Reports
    Replies: 16
    Last Post: 10-27-2011, 09:51 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