MS Access 2003/2007 VBA. How can I take a date field from a recordset and enter the format dd-MMM-yyyy?

I have some VB that uses DAO to capture some data, with one field being a date field (like in a transaction date). its not a date / time, just enter a date like dd / mm / yyyy.

so in the access form I know how to do this, but now I'm working on some excel / ppt automation. I am using something like this simple DAO sql string, openrecordset example to get data.

So let's say that the data in question is just rs! Date

I move it to powerpoint as follows:

Set oShape = oSlide.Shapes("S1_Date")
Set oTextRange = oShape.textFrame.TextRange

     oTextRange.Text = rs!Date

now I leave all kinds of things, but this is the part that passes this date that I already have in the recordset to ppt pres is just fine, only in this format

dd/mm/yyyy

,

"dd-MMM-yyyy"

.

+3
3

:

oTextRange.Text = Format(rs![Date], "dd-MMM-yyyy")

, Date . , - . , , .

+3
+1

, , - , , .... .

i figure , , -

Set oShape = oSlide.Shapes("S1_Date")
Set oTextRange = oShape.TextFrame.TextRange

     oTextRange.Text = Format(rs!Date, "dd-MMM-yyyy")

. .

EDIT: Oh .... sorry there were no other answers when I posted this!

+1
source

Source: https://habr.com/ru/post/1751628/


All Articles