Solved

String Change

Posted on 1999-01-11
4
179 Views
Last Modified: 2010-05-03
I am looking for a short way to change a string and display it in label2.caption. All i want to do is label1.caption has the current date and Time and I want label2.caption to be  to look like "mm/dd/yyyy" Only PLUS 1 day.   With out using the datediff statement. my end result would look somthing like this

label1.caption "01/12/1999 01:02:03" and label2.capption "01/13/1999"  



Private Sub Form_Load()

Dim StsStr
SysStr = Format((Now), "mm/dd/yyyy" & " " & "hh:mm:ss")
    Label1.Caption = SysStr
    Label2.Caption =
0
Comment
Question by:raider187
4 Comments
 
LVL 3

Accepted Solution

by:
traygreen earned 50 total points
ID: 1455604
Use the DateAdd function
label2.caption = format(DateAdd("d", 1,label1.caption), "mm/dd/yyyy")
0
 
LVL 1

Expert Comment

by:tommy_boy
ID: 1455605
Private Sub Form_Load()

Dim StsStr
SysStr = Format((Now), "mm/dd/yyyy" & " " & "hh:mm:ss")
Label1.Caption = SysStr
Label1.refresh
Label2.Caption = CDate(Label1.caption) + 1




0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1455606
tommyboy code works well

0
 
LVL 1

Author Comment

by:raider187
ID: 1455607
Execelent, it worked perfect, Thank you very much ....Raider
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question