Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / November 2004

Tip: Looking for answers? Try searching our database.

Date and time picker control MSCOMCT2.OCX

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mel - 04 Oct 2004 18:06 GMT
Hi,
   I need to use a Null value with the DTP control.    
Other than the checkbox property, does it have any workaround solution ?
does it exist a new .OCX that support the null value now?

My second problem with that control is that I'm not able to use a default value correctly.
The default value must be the next Thusday as this function discribe it:
 Public Function getdate() As Variant
   Dim today As Date
   Dim daycount As Integer
   Dim index As Integer

   daycount = 0
   today = Now

   Do While WeekDay(today) <> vbThursday
       today = DateAdd("d", 1, today)
       daycount = daycount + 1
   Loop

   If daycount = 0 Then
      today = DateAdd("d", 7, today)
   End If

   index = InStr(1, today, Space(1))
   getdate = Left(today, index)

 End Function
The only way I found to this is to put the call to this function into the Form_Current() like that:
   If Me.NewRecord Then
        Me.dtpDueDate.Value = getdate()
  End If

It works, but the problem is that it create a new record even if I navigate Back with the record selector.  How can I cancel the update of the newly created record if nothing have been entered? (...only the default date by getdate()).   Or how can I simulate the real DefaultValue property like the other control?

tx for any support

Melanie,
mtl, Quebec
mbourbonNOSPAMSSS@cae.com
Alex Dybenko - 05 Oct 2004 07:10 GMT
for other control solutions look at Tony page:
http://www.granite.ab.ca/access/calendars.htm

Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

Hi,
   I need to use a Null value with the DTP control.
Other than the checkbox property, does it have any workaround solution ?
does it exist a new .OCX that support the null value now?

My second problem with that control is that I'm not able to use a default
value correctly.
The default value must be the next Thusday as this function discribe it:
Public Function getdate() As Variant
Dim today As Date
Dim daycount As Integer
Dim index As Integer

daycount = 0
today = Now

Do While WeekDay(today) <> vbThursday
   today = DateAdd("d", 1, today)
   daycount = daycount + 1
Loop

If daycount = 0 Then
  today = DateAdd("d", 7, today)
End If

index = InStr(1, today, Space(1))
getdate = Left(today, index)

End Function
The only way I found to this is to put the call to this function into the
Form_Current() like that:
   If Me.NewRecord Then
       Me.dtpDueDate.Value = getdate()
  End If

It works, but the problem is that it create a new record even if I navigate
Back with the record selector.  How can I cancel the update of the newly
created record if nothing have been entered? (...only the default date by
getdate()).   Or how can I simulate the real DefaultValue property like the
other control?

tx for any support

Melanie,
mtl, Quebec
mbourbonNOSPAMSSS@cae.com
bobo - 28 Nov 2004 08:46 GMT
 Hi,
     I need to use a Null value with the DTP control.    
 Other than the checkbox property, does it have any workaround solution ?
 does it exist a new .OCX that support the null value now?
 
 My second problem with that control is that I'm not able to use a default value correctly.
 The default value must be the next Thusday as this function discribe it:
   Public Function getdate() As Variant
     Dim today As Date
     Dim daycount As Integer
     Dim index As Integer
     
     daycount = 0
     today = Now
     
     Do While WeekDay(today) <> vbThursday
         today = DateAdd("d", 1, today)
         daycount = daycount + 1
     Loop
     
     If daycount = 0 Then
        today = DateAdd("d", 7, today)
     End If
     
     index = InStr(1, today, Space(1))
     getdate = Left(today, index)

   End Function
 The only way I found to this is to put the call to this function into the Form_Current() like that:
     If Me.NewRecord Then
         Me.dtpDueDate.Value = getdate()
    End If
 
 It works, but the problem is that it create a new record even if I navigate Back with the record selector.  How can I cancel the update of the newly created record if nothing have been entered? (...only the default date by getdate()).   Or how can I simulate the real DefaultValue property like the other control?
 
 tx for any support
 
 Melanie,
 mtl, Quebec
 mbourbonNOSPAMSSS@cae.com
bobo - 28 Nov 2004 08:47 GMT
 Hi,
     I need to use a Null value with the DTP control.    
 Other than the checkbox property, does it have any workaround solution ?
 does it exist a new .OCX that support the null value now?
 
 My second problem with that control is that I'm not able to use a default value correctly.
 The default value must be the next Thusday as this function discribe it:
   Public Function getdate() As Variant
     Dim today As Date
     Dim daycount As Integer
     Dim index As Integer
     
     daycount = 0
     today = Now
     
     Do While WeekDay(today) <> vbThursday
         today = DateAdd("d", 1, today)
         daycount = daycount + 1
     Loop
     
     If daycount = 0 Then
        today = DateAdd("d", 7, today)
     End If
     
     index = InStr(1, today, Space(1))
     getdate = Left(today, index)

   End Function
 The only way I found to this is to put the call to this function into the Form_Current() like that:
     If Me.NewRecord Then
         Me.dtpDueDate.Value = getdate()
    End If
 
 It works, but the problem is that it create a new record even if I navigate Back with the record selector.  How can I cancel the update of the newly created record if nothing have been entered? (...only the default date by getdate()).   Or how can I simulate the real DefaultValue property like the other control?
 
 tx for any support
 
 Melanie,
 mtl, Quebec
 mbourbonNOSPAMSSS@cae.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.