Solved

String Change

Posted on 1999-01-11
4
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month4 days, 23 hours left to enroll

636 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