[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

DTPicker

hi,
 How could i do this:
 Q - The backdating can only go back until 1/5/06, subject to not being more than 6 months from today - users requirement.

Thanks
wz


0
wzm
Asked:
wzm
  • 3
  • 2
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Private Sub DTPicker1_Change()
  If DTPicker1.Value < DateAdd("M", -6, Now) Then
    DTPicker1.Value = DateAdd("M", -6, Now)
  End If
End Sub

the user can still scroll to any date, but the selected date will not be before 6 months
0
 
wzmAuthor Commented:
if now = 1/12/2006 - the minimum backdate = 1/6/2006

if now = 1/6/2006 - subjected to 1/5 as the benchmark - = 1/5/2006

if now = 1/12/2008 - minumum = 1/6/2008

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Private Sub DTPicker1_Change()
  If DTPicker1.Value < DateAdd("M", -6, Now) Then
    DTPicker1.Value = DateAdd("M", -6, Now)
  End If
  if DTPicker1.Value < DateSerial(2006,5,1) then
    DTPicker1.Value = DateSerial(2006,5,1)
  end if
End Sub
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
g_johnsonCommented:
are you saying not more than 6 days ago and not more than 6 months from now, limited by 1/5/06?

If so,

if dtp1.value < dateadd("d",-6,date) then
   dtp1.value = dateadd("d",-6,date)
elseif dtp1.value > dateadd("m",6,date) then
   dtp1.value = dateadd("m",6,date)
end if

if dtp1.value < cdate("01/05/2006") then
    dtp1.value = cdate("01/05/2006")
endif

does that do it?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
yes, that looks fine
0
 
wzmAuthor Commented:
" are you saying not more than 6 days ago and not more than 6 months from now, limited by 1/5/06? "

 - 6 days ago = no
 - 6 months ago = yes
 - 6 months from now = no
 - date is equal to current day (default) and cannot allow user to
   move forward, only backward and;
   = minimum(1/5/06,current date - 6 months)
   where the backdating span is within 6 months period.
 (this is for insurance industries practice)

hope that's clear.. hard for me to understand myself. :)

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.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now