If there is no date in Datum, I get an error when usingNo error when usingCode:=WeekdayName(Weekday([Datum]),False,1)Code:=Format([datum],"dddd")
If there is no date in Datum, I get an error when usingNo error when usingCode:=WeekdayName(Weekday([Datum]),False,1)Code:=Format([datum],"dddd")
If this helped, please click the star * at the bottom left and add to my reputation- Thanks
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.
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 shownBut 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
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
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 ↓↓
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).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
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.
If you want to modify that control, then do so in VBA and not as a controlsource.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
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
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]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
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
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
Thanks.
But it throws me a #Typ error!
Ondrej
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 ↓↓
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
If I use format(Date,"dddd dd.mm.yyyy")
Where should I put it?
And instead of Date there should be [Datum], right?
Ondrej