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