waiting time (1 Viewer)

theinviter

Registered User.
Local time
Today, 05:58
Joined
Aug 14, 2014
Messages
240
Hi :
i need any help, is there a way to make through access a form that will accept enter of number and then calculate the waiting time as that present in the bank.

thank you
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:58
Joined
May 7, 2009
Messages
19,233
you need to add a Timer Event on your form to do that.
supposed you have a Textbox (txtNumber) that will accept
the number and another textbox (txtWaitingTime) to show the waiting time,
then your timer event would look something like
this:

Code:
Private Sub Form_Timer()
    Me.txtWaitingTime = WaitingTime(Me.txtNumber)
End Sub

and the WaitingTime function would look something
like this:

Code:
Public Function WaitingTime(var As Variant) As String
    Static anyThing As Variant
    Static thisTime As Date
    If anyThing <> var Then
        anyThing = var
        thisTime = Now
    End If
    WaitingTime = Format(Now - thisTime, "hh:nn:ss")
End Function
 

theinviter

Registered User.
Local time
Today, 05:58
Joined
Aug 14, 2014
Messages
240
can you please attache example ..
thank you
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:58
Joined
May 7, 2009
Messages
19,233
here is a sample.
open Form1.
 

Attachments

  • Database4.zip
    65.8 KB · Views: 83

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:58
Joined
Feb 28, 2001
Messages
27,140
Can you clarify your intent?

I interpreted your question to mean that you would enter a number of people waiting in line and get an estimate of how long before the last person in line gets served?

Access can surely do that, but Arnel saw that question one way and I saw it another way, which means there is some uncertainty in what you asked. I'm not saying we can't help you, but we can't help you without a better understanding of what you are doing.
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:58
Joined
Jan 23, 2006
Messages
15,379
I agree with Doc that more info/clarification is needed.
To get a focused response that meets your requirements really depends on your providing as much relevant information as possible. Often giving a clear description; offering some sample data or an example of the starting situation; and an example of the "type of answer" you expect, will be best.
Readers should not have to guess at what you are trying to solve or what you are trying to do.

I read your post as Doc did ---you have X number of people in a queue waiting for service. How long before all people have been served?

You may get some ideas (at least concepts) by googling "queueing theory".
 

theinviter

Registered User.
Local time
Today, 05:58
Joined
Aug 14, 2014
Messages
240
Can you clarify your intent?

I interpreted your question to mean that you would enter a number of people waiting in line and get an estimate of how long before the last person in line gets served?

Access can surely do that, but Arnel saw that question one way and I saw it another way, which means there is some uncertainty in what you asked. I'm not saying we can't help you, but we can't help you without a better understanding of what you are doing.

yes i want it as you described .
 

theinviter

Registered User.
Local time
Today, 05:58
Joined
Aug 14, 2014
Messages
240
I agree with Doc that more info/clarification is needed.
To get a focused response that meets your requirements really depends on your providing as much relevant information as possible. Often giving a clear description; offering some sample data or an example of the starting situation; and an example of the "type of answer" you expect, will be best.
Readers should not have to guess at what you are trying to solve or what you are trying to do.

I read your post as Doc did ---you have X number of people in a queue waiting for service. How long before all people have been served?

You may get some ideas (at least concepts) by googling "queueing theory".


yes exactly , want to know how many people waiting for service and calculate the waiting time
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:58
Joined
Jan 23, 2006
Messages
15,379
It would seem you need to consider additional factors

-average time to process/serve a customer
-number of customers in the line
-rate at which Customers enter the queue.....

You might get more focused info by googling "waiting time single server queue"

There is info at this link.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:58
Joined
Feb 28, 2001
Messages
27,140
You can do this two ways. Quick and dirty or precise but somewhat variable.

Q&D: You give a rough estimate of how long a person's service time should be. Then you do this: On a form, enter a number in a text box and tab out of that text box.

On the text box's lost focus event, multiply the the number in the text box times the estimated wait time per person expressed as

Code:
Private Sub txtNumWaiting_LostFocus()

Dim EstWait as Date

EstWait = CDat( #hh:mm:ss# * CDbl([txtNumWaiting]) )

[WaitHMS] = Format( EstWait, "hh:mm:ss" )

End Sub

Now, why is this quick & dirty? No feedback on actual wait times.

To do it right, the estimated wait time changes as you have more customers AND more measures of how long they actually took. But doing it "the right way" involves the overhead of having someone whose job it is to keep statistics.
 

theinviter

Registered User.
Local time
Today, 05:58
Joined
Aug 14, 2014
Messages
240
i wanna make a form to auto generate a number on click of button , then after completion of service i just need to scan the number and it will calculate the time .
is there a way to do it
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:58
Joined
Jan 23, 2006
Messages
15,379
????
I'm not following this
to auto generate a number on click of button , then after completion of service i just need to scan the number and it will calculate the time .

How about n example to clarify the "number" and what it represents?
 

Users who are viewing this thread

Top Bottom