hello ackilesh
Page 1 of 1 • Share •
hello ackilesh
ok this is the code you gave me:
Dim ST, ET As String
Dim MM, TT As Integer
Private Sub Command1_Click()
ST = Time
End Sub
Private Sub Command2_Click()
ET = Time
TT = DateDiff("n", ST, ET)
If TT <= 30 Then
MM = 10
Else
MM = 10 + (0.33 * (TT - 30))
End If
Label1.Caption = "Start Time:" & ST & ">>" & "End Time:" & ET & ">>" & "Total mins. used:" & TT & ">>" & "Amount:" & " Php " & CStr(MM)
End Sub
pls helped me again T_T, my problem is i want the time to automatically stop, not just pressing a button because thats an OPEN TIME.
example theres a "2 text box" i will input the hour and minutes, then it will automatically stop when it reaches it, its like a stop watch
then last pls ^^, how to extend a time, example the client time is up, then he wanted to extend it, theres a button for that then it will show the 2 text box for hours and minutes, then it will add to the previous time and the rate will stack up.... pls help me T_T
Dim ST, ET As String
Dim MM, TT As Integer
Private Sub Command1_Click()
ST = Time
End Sub
Private Sub Command2_Click()
ET = Time
TT = DateDiff("n", ST, ET)
If TT <= 30 Then
MM = 10
Else
MM = 10 + (0.33 * (TT - 30))
End If
Label1.Caption = "Start Time:" & ST & ">>" & "End Time:" & ET & ">>" & "Total mins. used:" & TT & ">>" & "Amount:" & " Php " & CStr(MM)
End Sub
pls helped me again T_T, my problem is i want the time to automatically stop, not just pressing a button because thats an OPEN TIME.
example theres a "2 text box" i will input the hour and minutes, then it will automatically stop when it reaches it, its like a stop watch
then last pls ^^, how to extend a time, example the client time is up, then he wanted to extend it, theres a button for that then it will show the 2 text box for hours and minutes, then it will add to the previous time and the rate will stack up.... pls help me T_T
oyayi- Posts: 3
Join date: 2008-10-04
Re: hello ackilesh
Thanx for registering 

Akhilesh B Chandran- Administrator

- Posts: 26
Join date: 2008-09-29
Age: 19
Location: Trivandrum, Kerala, India

Re: hello ackilesh
higuys nice to be here
did you try the timer control
chagnge your coding like this
private sub timer1_timer()
TT = DateDiff("n", ST, ET)
if tt=0 then
timer1.enabled=false
endif
endsub
did you try the timer control
chagnge your coding like this
private sub timer1_timer()
TT = DateDiff("n", ST, ET)
if tt=0 then
timer1.enabled=false
endif
endsub
Last edited by thava on Sat Oct 04, 2008 4:02 pm; edited 1 time in total

thava- Posts: 3
Join date: 2008-10-04
Age: 27
Location: Madurai,Tamilnadu, india
reply solution
Try this:
- Code:
Dim counter, totlaM As Currency
Private Sub Command1_Click()
counter = 0
totlaM = CInt(Text1.Text)
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 60000 '60 secs
End Sub
Private Sub Timer1_Timer()
If counter < totalm Then
counter = counter + 1
Else
Timer1.Enabled = False
FuncDisplayAmount 'function to display and calcualte amount
End If
End Sub

Akhilesh B Chandran- Administrator

- Posts: 26
Join date: 2008-09-29
Age: 19
Location: Trivandrum, Kerala, India

Re: hello ackilesh
- Code:
Dim counter, totalM As Currency
Dim MM As Integer
Dim ST, ET As String
Private Sub Command1_Click()
counter = 0
totalM = CInt(Text1.Text)
ST = Time
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 60000 '60 secs
End Sub
Private Sub Timer1_Timer()
If counter <= totalm Then
counter = counter + 1
Else
Timer1.Enabled = False
ET = Time
FuncDisplayAmount 'function to display and calcualte amount
End If
End Sub
Private Function FuncDisplayAmount()
If counter <= 30 Then
MM = 10
Else
MM = 10 + (0.33 * (counter - 30))
End If
Label1.Caption = "Start Time:" & ST & ">>" & "End Time:" & ET & ">>" & "Total mins. used:" & counter & ">>" & "Amount:" & " Php " & CStr(MM)
End Function
Will this help you ...???

Akhilesh B Chandran- Administrator

- Posts: 26
Join date: 2008-09-29
Age: 19
Location: Trivandrum, Kerala, India

Re: hello ackilesh
Ok 
just think. U will get it:)
just think. U will get it:)

Akhilesh B Chandran- Administrator

- Posts: 26
Join date: 2008-09-29
Age: 19
Location: Trivandrum, Kerala, India

Re: hello ackilesh
your code works great, but how to add hours/minutes to a client while his time is running?? its like extending their time?
oyayi- Posts: 3
Join date: 2008-10-04
Re: hello ackilesh
Change the value of the variable totalm at runtime, if the time doesnt reached the limit. Else store the amount to another variable then restart the timer with the new totalm value, if the time reached the limit. Just think u will get it. Try doing the code urself, because it can give u much knowledge. 
if u have any problem,post it
if u have any problem,post it

Akhilesh B Chandran- Administrator

- Posts: 26
Join date: 2008-09-29
Age: 19
Location: Trivandrum, Kerala, India

Permissions of this forum:
You can reply to topics in this forum





