Statment issue

Does system date fall between to dates if so goto a sud

Page 1 of 1

3 Replies - 532 Views - Last Post: 25 February 2009 - 06:14 AM Rate Topic: -----

#1 stage1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-February 09

Statment issue

Post icon  Posted 24 February 2009 - 11:49 AM

HI,

I am very rusty in vb. here is my problem. I have a field called date (system date) i want to code if date is between two defined dates ie date between 03/01/2009 and 11/01/2009 and if so goto subA if false then goto subb.

Can anyone please help be, again i am a beginner and very rusty.

Thank you
Craig
Is This A Good Question/Topic? 0
  • +

Replies To: Statment issue

#2 Nikhil_07n  Icon User is offline

  • The cheese stands alone..
  • member icon

Reputation: 49
  • View blog
  • Posts: 2,489
  • Joined: 09-January 09

Re: Statment issue

Posted 24 February 2009 - 02:21 PM

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 stage1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-February 09

Re: Statment issue

Posted 24 February 2009 - 06:21 PM

View PostNikhil_07n, on 24 Feb, 2009 - 01:21 PM, said:

[rules][/rules]

Dim Getime
Getime = time
Dim Begin
Begin = Format(#3/1/2009#)
Dim End1
End1 = Format(11 / 1 / 2009)
Label3.Caption = Begin

Dim MyTimeAZ
Dim t
t = now() + TimeValue("00:00:00")
MyTimeAZ = Format(t, "hh:mm:ss AMPM")
Dim MyTimeE
Dim t0
t0 = now() + TimeValue("02:00:00")
MyTimeE = Format(t0, "hh:mm:ss AMPM")
Dim MyTimeED
Dim t1
t1 = now() + TimeValue("03:00:00")
MyTimeED = Format(t1, "hh:mm:ss AMPM")
Dim Tdate
Tdate = Format(Tdate, "m/d/yy")
Dim Between As Range
IF tdate is between Begin and End1 then

Select Case ComboBox2.TabIndex
    Case 0
    Label2.Caption = "az"
    Label3.Caption = MyTimeE
    Case Else
    Label4.Caption = t
    Label5.Caption = "SDT"
    End Select
End If


MOD EDIT: Fixed code tags
Was This Post Helpful? 0
  • +
  • -

#4 stage1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-February 09

Re: Statment issue

Posted 25 February 2009 - 06:14 AM

View Poststage1, on 24 Feb, 2009 - 05:21 PM, said:

View PostNikhil_07n, on 24 Feb, 2009 - 01:21 PM, said:

[rules][/rules]

Dim Getime
Getime = time
Dim Begin
Begin = Format(#3/1/2009#)
Dim End1
End1 = Format(11 / 1 / 2009)
Label3.Caption = Begin

Dim MyTimeAZ
Dim t
t = now() + TimeValue("00:00:00")
MyTimeAZ = Format(t, "hh:mm:ss AMPM")
Dim MyTimeE
Dim t0
t0 = now() + TimeValue("02:00:00")
MyTimeE = Format(t0, "hh:mm:ss AMPM")
Dim MyTimeED
Dim t1
t1 = now() + TimeValue("03:00:00")
MyTimeED = Format(t1, "hh:mm:ss AMPM")
Dim Tdate
Tdate = Format(Tdate, "m/d/yy")
Dim Between As Range
IF tdate is between Begin and End1 then

Select Case ComboBox2.TabIndex
    Case 0
    Label2.Caption = "az"
    Label3.Caption = MyTimeE
    Case Else
    Label4.Caption = t
    Label5.Caption = "SDT"
    End Select
End If


MOD EDIT: Fixed code tags

Excuse me for beiing new to this but is the above my code with corrections as i cant find anything different? soory for asking again i have adeadline of thurs too finish this project. thank you for your time Craig
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1