Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
  1. #16
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,656
    If there is no date in Datum, I get an error when using
    Code:
    =WeekdayName(Weekday([Datum]),False,1)
    No error when using
    Code:
    =Format([datum],"dddd")

    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  2. #17
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,826
    I have to wonder why 2 fields or form controls are needed. If one has the date why not just format it as Long Date, or maybe as suggested in post 2?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #18
    ondrejruz is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2022
    Posts
    16
    But I don't want it to work in two TextBoxes... TextBox2 is updated late. If I only used TextBox1 and chained the results of the two functions Weekday and WeekdayName into it..... For example the result would be: 13/10/2022 – Thursday Could this be done with built-in functions? Ondrej

  4. #19
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,017
    Quote Originally Posted by ondrejruz View Post
    But I don't want it to work in two TextBoxes... TextBox2 is updated late. If I only used TextBox1 and chained the results of the two functions Weekday and WeekdayName into it..... For example the result would be: 13/10/2022 – Thursday Could this be done with built-in functions? Ondrej
    Yes, as already shown
    Just concatenate the values into the one control.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #20
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Just use a little used and often overlooked function like

    ? Format (Date(),"dd/mm/yyyy - dddd")
    13/10/2022 - Thursday

    Seems pretty simple to me.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  6. #21
    Join Date
    Apr 2017
    Posts
    1,687
    Quote Originally Posted by ondrejruz View Post
    But I don't want it to work in two TextBoxes... TextBox2 is updated late. If I only used TextBox1 and chained the results of the two functions Weekday and WeekdayName into it..... For example the result would be: 13/10/2022 – Thursday Could this be done with built-in functions? Ondrej
    Create a calendary table (which has a date field containing a list of dates from some start date to some date in future, plus any other wields you may need for other purpouses). Instead of text box, use a combo box to select/enter the date from calendary table. The row source of combo is a query which returns a list of dates in one column, and a calculated text (something like "13/10/2022 – Thursday") in second field. You link the combo to date field of your data table - like your current text box - and mark 1st column of row source as bound column, and 2nd column as visible one (non-zero width).

  7. #22
    ondrejruz is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2022
    Posts
    16
    Hello. If the TexBox date is a long format, e.g. Thursday, 13. October 2022, cannot be modified as a string to: Thursday, 13.10. 2022,
    with the fact that some query in VB is used, e.g. ?
    I'm a total beginner in Access, so maybe this is an irrelevant question...
    Ondrej
    Last edited by ondrejruz; 10-13-2022 at 11:53 AM.

  8. #23
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,017
    Quote Originally Posted by ondrejruz View Post
    Hello. If the TexBox date is a long format, e.g. Thursday, October 13, 2022, cannot be modified as a string to: Thursday, September 13, 2022,
    with the fact that some query in VB is used, e.g. ?
    I'm a total beginner in Access, so maybe this is an irrelevant question...
    Ondrej
    If you want to modify that control, then do so in VBA and not as a controlsource.
    However, now you are moving the goalposts.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  9. #24
    ondrejruz is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2022
    Posts
    16
    Hello. Yesterday I answered your posts here, but today I don't see it here....
    Thank you all again for your contributions!
    So:
    the long date format in TexBox is e.g. Friday, 14. October 2022.
    I would need a shape like this: Friday 14.10.2022.
    Is there a function for this somewhere?
    Or it could somehow be changed in the query using VB, or .....
    Ondrej

  10. #25
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,545
    Quote Originally Posted by ondrejruz View Post
    Hello. Yesterday I answered your posts here, but today I don't see it here....
    Thank you all again for your contributions!
    So:
    the long date format in TexBox is e.g. Friday, 14. October 2022.
    I would need a shape like this: Friday 14.10.2022.
    Is there a function for this somewhere?
    Or it could somehow be changed in the query using VB, or .....
    Ondrej
    Perhaps something like: =WeekdayName(Weekday([Datum]),False,1) & " " & [datum]
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  11. #26
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,017
    Nothing wrong with Bob's solution as long as there will also be a value
    Minty's solution works just as well, and has the benefit of not erroring if no value.?
    Horses for courses.

    You can test all this yourself in the immediate window?
    My date format in the uk is dd/mm/yyyy

    Code:
    ? format(Date,"dddd dd.mm.yyyy")
    Friday 14.10.2022
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  12. #27
    ondrejruz is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2022
    Posts
    16
    Thanks.
    But it throws me a #Typ error!
    Ondrej

  13. #28
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Ondrej, When you post back about an error please include the exact code / syntax you have used.
    We can't guess what might be wrong!
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  14. #29
    ondrejruz is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2022
    Posts
    16
    I used the function on the Data tab, Source of the control: =WeekdayName(Weekday([datum];2);False;2) & " " & [datum]
    And it throws me a #Type error
    Ondrej

  15. #30
    ondrejruz is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2022
    Posts
    16
    If I use format(Date,"dddd dd.mm.yyyy")
    Where should I put it?
    And instead of Date there should be [Datum], right?
    Ondrej

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Problem with date conversion
    By WAVP375 in forum Access
    Replies: 2
    Last Post: 07-07-2018, 02:02 PM
  2. Conversion of Date/Time field from Access to SQL
    By Robert2150 in forum SQL Server
    Replies: 4
    Last Post: 10-02-2016, 01:37 PM
  3. Type Conversion Failure of date field in Access
    By accessmatt in forum Queries
    Replies: 4
    Last Post: 05-01-2015, 03:39 PM
  4. Date Conversion
    By mslenker in forum Access
    Replies: 1
    Last Post: 01-30-2013, 09:52 AM
  5. Date Conversion
    By mkc80 in forum Access
    Replies: 1
    Last Post: 06-27-2012, 04:04 PM

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