Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2013
    Posts
    22

    Question Unanswered: How to set a date for each value to increment from the previous value

    Hey there can anyone help me and give me examples. I am still developing in Access.
    I got open hours which start with 2000 and closing hours that start with 4000 and I got a date value for instance 4/24/2013 if I enter a new date like tommorow 4/25/2013 then the closing hours of 4000 will become the opening hours 4000 can this be done using macros queries vba if you understand what I mean can you please provide me with this code and examples. Thanks in advance!!!

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    I actually answered an identical question (not sure whether here or elsewhere) a couple of days ago. Use code like this in the Default Value Property of the Opening Hours Control, on your Form:

    =Nz(DMax("[Closing Hours]","YourTableName"))

    replacing all names with your actual names.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Apr 2013
    Posts
    22
    replacing all names with your actual names.

    Linq ;0)>

    Sorry I'm lost what you mean by the above!!!

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    When someone responds to a post with example code they seldom know the names of your objects, such as Field/Control names, Table names, etc.

    When using that code you have to replace those names with the names you're actually using. In the above code, unless your Table is actually named YourTableName and you Textbox is actually named Closing Hours (space and all) you have to replace them with the actual names of your Table and your Textbox, in order for the code to work!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Apr 2013
    Posts
    22
    Thank you very much it help me aloth

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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
  •