I have a textbox in a form with the Control Source "="SH-OH-" & [DocumentYear] & "-" & [8130-3_ID]".
The result = SH-OH-10/31/2023 3:51:44-786.
I need result =SH-OH-2023-786.
Thanks!
I have a textbox in a form with the Control Source "="SH-OH-" & [DocumentYear] & "-" & [8130-3_ID]".
The result = SH-OH-10/31/2023 3:51:44-786.
I need result =SH-OH-2023-786.
Thanks!
Perhaps something like:
"="SH-OH-" & Year([DocumentYear]) & "-" & [8130-3_ID]".
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
Hi Bob,
I get an invalid syntax error.
Show us your version
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
I figured it out.
The form was based on a qry. I used the Expression "Year: Format([DocumentYear],'yyyy')" and this fixed it.