hello ackilesh

Post new topic   Reply to topic

View previous topic View next topic Go down

hello ackilesh

Post by oyayi on Sat Oct 04, 2008 3:54 pm

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

oyayi

Posts: 3
Join date: 2008-10-04

View user profile

Back to top Go down

Re: hello ackilesh

Post by Akhilesh B Chandran on Sat Oct 04, 2008 3:55 pm

Thanx for registering Smile

Akhilesh B Chandran
Administrator
Administrator

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

View user profile http://askq.forumotion.net

Back to top Go down

Re: hello ackilesh

Post by thava on Sat Oct 04, 2008 3:58 pm

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


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

View user profile

Back to top Go down

reply solution

Post by Akhilesh B Chandran on Sat Oct 04, 2008 4:02 pm

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
Administrator

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

View user profile http://askq.forumotion.net

Back to top Go down

Re: hello ackilesh

Post by Akhilesh B Chandran on Sat Oct 04, 2008 4:18 pm

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 ...??? Smile

Akhilesh B Chandran
Administrator
Administrator

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

View user profile http://askq.forumotion.net

Back to top Go down

Re: hello ackilesh

Post by oyayi on Sun Oct 05, 2008 7:32 am

ok ty ill try it ^^

oyayi

Posts: 3
Join date: 2008-10-04

View user profile

Back to top Go down

Re: hello ackilesh

Post by Akhilesh B Chandran on Sun Oct 05, 2008 8:01 am

Ok Smile
just think. U will get it:)

Akhilesh B Chandran
Administrator
Administrator

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

View user profile http://askq.forumotion.net

Back to top Go down

Re: hello ackilesh

Post by oyayi on Tue Oct 07, 2008 8:10 pm

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

View user profile

Back to top Go down

Re: hello ackilesh

Post by Akhilesh B Chandran on Tue Oct 07, 2008 8:47 pm

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. Smile
if u have any problem,post it Smile

Akhilesh B Chandran
Administrator
Administrator

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

View user profile http://askq.forumotion.net

Back to top Go down

View previous topic View next topic Back to top


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