Reply

Join Date: Jul 2008
Posts: 3
Reputation: fa_hed is an unknown quantity at this point 
Solved Threads: 0
fa_hed fa_hed is offline Offline
Newbie Poster

maskedbox

 
0
  #1
Jul 4th, 2008
I have a form has to (maskedbox1) and (maskedbox2)
if maskedbox1 I put date of today, I want (maskedbox2) show date after 30 days as defult
I will be thank you if you help me to do this
I use vb6
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: maskedbox

 
0
  #2
Jul 4th, 2008
To calculate after 30 days you can use DateAdd() function

Example

Draw two MaskEdit Controls and One Command Button

  1.  
  2. Private Sub Command1_Click()
  3. Dim FormatDate As String
  4. Dim DateAfter30Days As Date
  5.  
  6. DateAfter30Days = CDate(MaskEdBox1.Text)
  7. DateAfter30Days = DateAdd("d", 30, DateAfter30Days)
  8. FormatDate = Format(DateAfter30Days, "dd/MM/yy")
  9. MaskEdBox2.Text = FormatDate
  10.  
  11. End Sub
  12.  
  13. Private Sub Form_Load()
  14. MaskEdBox1.Mask = "##/##/##"
  15. MaskEdBox2.Mask = "##/##/##"
  16. MaskEdBox1.Text = Format(Date, "dd/MM/yy")
  17. End Sub
KSG
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,640
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: maskedbox

 
0
  #3
Jul 4th, 2008
selvaganapathy was given great code...
also you can try use DateSerial()
DateSerial(Year,Month,Day)
This will add 20 days from 5 July 2008.
  1. Private Sub Form_Load()
  2. MsgBox DateSerial(2008, 7, 5 + 20)
  3. End Sub
Result : 7/25/2008

This will count the 50 days from 1 July 2008.
  1. Private Sub Form_Load()
  2. MsgBox DateSerial(2008, 7, 50)
  3. End Sub
Result : 8/19/2008
Last edited by Jx_Man; Jul 5th, 2008 at 12:21 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 3
Reputation: fa_hed is an unknown quantity at this point 
Solved Threads: 0
fa_hed fa_hed is offline Offline
Newbie Poster

Re: maskedbox

 
0
  #4
Jul 5th, 2008
Thank Mr. selvaganapathy
I have another quition:
can I use paper A5 with datereport?
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: maskedbox

 
0
  #5
Jul 5th, 2008
I think, we cannot set paper A5. but you can ReportWidth property. i dont think it will be A5 size.
KSG
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC