Results 1 to 7 of 7
  1. #1
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138

    Show different date format in message box in access

    I have a messagebox and want to know if it is possible that the messagebox give me a date as 15/01/2015 and not 15/01/2015. Using dailog box as messagebox

    Here is my code, but I think I am doing somthing wrong

    I have tried both of this, but no luck



    Code:
    Private Sub Save_Click()
    Dim LValue As String
    LValue = Format(DateSendOut, "dd/mm/yyyy")
    Dialog.Box "Tape #                : " & Me.Tape & vbCrLf & "Sticker #             : " & Me.Container1 & vbCrLf & "Book #                : " & Me.Book & vbCrLf & "Date send Out    : " & Me.DateSendOut & vbCrLf & "Date to be back  : " & Me.DateToBeBack & vbCrLf & "OS                       : " & Me.System, , "Saving............."
    end sub
    Code:
    Private Sub Save_Click()
    Dim LValue As String
    LValue = Format(Date, "dd/mm/yyyy")
    Dialog.Box "Tape #                : " & Me.Tape & vbCrLf & "Sticker #             : " & Me.Container1 & vbCrLf & "Book #                : " & Me.Book & vbCrLf & "Date send Out    : " & Me.DateSendOut & vbCrLf & "Date to be back  : " & Me.DateToBeBack & vbCrLf & "OS                       : " & Me.System, , "Saving............."
    end sub

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    With your form open in design view. Place your cursor on the text box you wish to format. Right Click and select Properties. Click on the Format tab. Scroll down to Font Weight and select Bold. Close the Properties and save the form. Reopen in Form view.

  3. #3
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138
    Quote Originally Posted by alansidman View Post
    With your form open in design view. Place your cursor on the text box you wish to format. Right Click and select Properties. Click on the Format tab. Scroll down to Font Weight and select Bold. Close the Properties and save the form. Reopen in Form view.
    No that is not what I want, I want my message box to show my date as 27/01/2014 but it is showing 01/27/2014, I need the date format to change, I only make the date bold, to show what I want the date to look like.

    Sorry if I have confused you

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    You can format the date in any form to display. Replace the Date() in the expression with your date field.
    Ex: Format (Date(),"dd mmmm,yyyy") : 07 January,2015
    Format (date(),"dd/mm/yyyy") : 7/01/2015
    Format (date(),"dd/mm/yy") : 07/01/15
    Format (date(),"ddd mmm dd,yyyy") : Wed Jan 07,2015
    I don't think you can format the messagebox to display font in bold. This link shows a different approach for enhancing controls on message box, not sure if it will help you.
    http://blog.nkadesign.com/2008/ms-ac...x-replacement/

  5. #5
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138
    Thank You, I have got it to work

  6. #6
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I am glad you got what you wanted, but here is what you asked for

    I have a messagebox and want to know if it is possible that the messagebox give me a date as 15/01/2015 and not 15/01/2015.
    Clearly you need to pay close attention to what you request.

  7. #7
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138
    Quote Originally Posted by alansidman View Post
    I am glad you got what you wanted, but here is what you asked for

    Clearly you need to pay close attention to what you request.
    I did get what I was looking for, I did not need it to be bold, I only make it bold to show the difference of the date, that I want to have, sorry for the confusing I have make here.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-03-2014, 03:14 AM
  2. Can access format a date in an odd way? DD-MMM-YYYY
    By redbull in forum Programming
    Replies: 3
    Last Post: 08-23-2013, 11:34 AM
  3. Replies: 4
    Last Post: 03-12-2013, 06:49 PM
  4. Replies: 4
    Last Post: 08-26-2010, 09:44 PM
  5. Access VBA - date format conversion
    By benattal in forum Programming
    Replies: 3
    Last Post: 12-22-2008, 10:40 AM

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