Open Tech Support
Open 

Tech Support Community
Back to HomeCommunityReviewsGuidesDownloadsLinkageMarketplaceContact Us

 »  Forum Navigation

Home
Post a Question
About Our Site
Support Our Site

What is this site?
Who are we?

Tolitz.Com - The Cynic Eye of the Third World Guy

Enhanced with Snapshots

 

 »  Advertisement


Go Back   Open Tech Support Community > SUPPORT FORUMS > Software




Reply

 

LinkBack Thread Tools
Old 10-03-2005, 11:49 PM   #1 (permalink)

Newcomer
 
Join Date: Oct 2005
Posts: 2


form created in MS Word

undefinedundefinedundefined


I currently have a form that I use that sutomatically brings up a calendar when you enter the start date and end date fields. I would like to have the calendar open with the surrent date. At this time it opens with a December 2000 date. This is the VB macro that it rums on:

Option Explicit
Public sDate As String 'used to write value from calendar form to form field
Public fFlag As Boolean 'did they cancel in calendar



Sub usbStartDate()
'This is the code called by start date form field

Const sfield As String = "txtStartDate"
frmCalendar.Show

If fFlag Then 'They hit enter date button
ActiveDocument.FormFields(sfield).Result = sDate 'Enter the date
Else 'They hit cancel
MsgBox "Date selection was cancelled. Please select a date"
usbStartDate 'Keep running until date is selected
End If

End Sub

Sub usbEndDate()
'This is the code called by end date form field

Const sfield As String = "txtEndDate"
frmCalendar.Show

If fFlag Then 'They hit enter date button
ActiveDocument.FormFields(sfield).Result = sDate 'Enter the date
Else 'They hit cancel
MsgBox "Date selection was cancelled. Please select a date"
usbStartDate 'Keep running until date is selected
End If

End Sub

Any help would be graatly appriciated. Thanks.
msmoots is offline   Reply With Quote
Sponsored Links
Old 10-04-2005, 07:24 AM   #2 (permalink)

Super Freak
 
DemonBob's Avatar
 
Join Date: Dec 2000
Location: Hammond, Lousiana, United States
Posts: 1,343


Re: form created in MS Word

It's been awhile since i fooled around with VB much less VB Macros. But I believe what your going to have to do is to get the current date, from the system using something along these lines.

Code:
Public Property Today() As DateTime
.
.
.
.
Dim MyDate As Date
MyDate = Today   ' Return current system date.
Then pass it to the calander to use as it's referance point.

If you want i can PM you my e-mail address and you can send me the form, and i should be able to figure it out, since coding is like riding a bike, once you do it once you never forget

-----------------------------
dd if=/dev/zero of=/dev/hdx bs=4096

Dustin B Coates
Network Engineer - System's Admin
SystemOverload.Net: A Simple Man, A Complex Mind: Ramblings of a Geek
DemonBob is offline   Reply With Quote
Old 10-04-2005, 05:41 PM   #3 (permalink)

Newcomer
 
Join Date: Oct 2005
Posts: 2


Re: form created in MS Word

----

Last edited by msmoots; 10-04-2005 at 06:00 PM..
msmoots is offline   Reply With Quote
Reply

Bookmarks

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
Compatibility problems between Word 2003 and earlier versions of word rossi2kuk Software 2 01-11-2005 03:48 AM
Convert Word 2002 Doc to Adobe PDF nancooks Software 7 08-29-2004 12:45 PM
6th form of matter created SKYHN General and Off Topic 13 02-05-2004 05:50 PM
Software? Axim5 Software 2 06-05-2003 01:28 PM







Powered by vBulletin® Version 3.8.2. Copyright © 2000-2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2
Copyright 2000-2008 Open Tech Support.  All Rights Reserved.  Site Design and Development by Tolitz Rosel.