Convert Mins:Secs To Hours:Mins Depend On Units Built

Dec 15, 2007

This is something I've been working on that very nearly works until it get to point DM

What I need to do is convert a build time for a single unit which is stored as mins:seconds into a build time depending on number of units being built then display the time as Hours:Mins.

I don't know of any functions in access that do this so have been playing with the code below which works upto the point of DM where I need to add the mins together then if more than 59 add the hour(s) to hours and then use the mins part as the total mins.

It needs a lot of cleanning up as been playing but hope somebody can help.

T = The Time IE 2:43
N = Number of units being built

Function GetTotalTime(T As String, N As Long) As String
Dim M As Double, S As Double, Y As Integer, MZ As Integer, MS As Long, H As Single, Min As Long, MM As Long
Dim DM As Long, Z As Integer
Y = InStr(T, ":")
If Y <> 0 Then
'Do The Mins Convert To Hours First
M = Left(T, Y - 1)
If M > 0 Then
M = M * N 'Minutes * Number Of Units
'Convert Total Mins Into Hours
M = M / 60
Z = InStr(M, ".")
H = Left(M, Z - 1)
'The Left Over Mins
Min = Mid$(M, Z + 1, Len(M))
End If
'Do The Seconds
S = Mid(T, Y + 1, Len(T))
If S > 0 Then
S = S * N 'Seconds * Number Of Units
If S > 59 Then 'Has Minutes
S = S / 60 'Convert Total Seconds To Mins.Seconds
MZ = InStr(S, ".")
MM = Left(S, MZ - 1)
'Dont worry bout odd seconds
Else
MZ = InStr(S, ".")
MM = Left(S, MZ - 1)
End If
End If
End If
'Now Add The Mins Together then / 60 to get hour /mins and add the hours to hours the remaining mins are the total mins element for build.
DM = MM + Min

GetTotalTime = H & ":" & DM

End Function


Many thanks

Mick

View Replies


ADVERTISEMENT

2 Mins Of Your Time! Shortcut Menu

Mar 13, 2007

Hello,

I am going crazy! I have managed to do this in a previous database and now I can't remember how I did it.

I want to create a shortcut menu for a report that when I right click the mouse button it gives me the option to print. When I select print on this shortcut menu it goes straight to the printer instead of giving me the printer dialogue box.

Please help!

Thanks

View 4 Replies View Related

Queries :: Convert Decimal Part Days To Hours

Dec 23, 2014

I have a query result for example = 2.19 days worked. The result of cumulated hours divided by 8 (hours in the workday). What I want to do is take the .19 and multiply it by 8 (hours in the workday) and I would have the result in actual hours which is what I need. Or of course if there is a way to display that into 2 days and 1.52 hours Rounded up to quarters would be even better. But with spending hours looking through forums I didn't find a way to just work with the decimals right of the dot. Trim, format, Len didn't work for me, they all give me funny result.

View 7 Replies View Related

Convert Hours & Minutes To Minutes

Jan 22, 2008

How can I convert hours and minutes to minutes as an Integer?

For example, convert 2:15 to 135.

Any help is greatly appreciated.

View 8 Replies View Related

Queries :: Subtract 8 Hours Of Work From Result Hours

Nov 29, 2014

I want to subtract 8 hours of work of the Result of employee work hours/

There is attachment...

View 3 Replies View Related

Forecast Units

Feb 7, 2008

I am drawing a blank on how to proceed with this requirement and was hoping someone out there could help me.

I am creating a graph that shows all of the orders we have taken, shipped, and what we have bid on. There is a table that holds the customer, no of units ordered, no of boxes per unit, number of units to ship each week and start date.

I need a formula that will calculate all of the week ending dates until the no of units ordered is 0.

For example, Capital ordered 100 units, 12 boxes per unit, 2 units to ship per week and shipments are scheduled to start on 2/19.


I would need it to display:

W/E Units Boxes
2/23 2 24
3/1 2 24
3/8 2 24 etc....

Until the total units ordered equals 0

This information is diplayed on a graph. The graph shows all of our open bids and based on shipments per week, displays a forecast of what's coming up.

Any help would be greatly appreciated.

View 9 Replies View Related

Units, Tens, Hundreds/IP Address

Jan 21, 2008

How can I place numbers side by side in the units, tens, hundreds etc

so if I have expr1, expr2, expr3........and I want them to appear side by side.

so expr1=1, expr2=3, expr3=0

This would appear as 130

However if expr1=0, expr2=3, expr3=0

I would like tis to appear as 030

I am sure I am going about this the long way but I am trying to create a query that wites out the full ip address i.e. 111.111.111.111.......not really sure to go about this so I am going to try and strip everything down to 1 digit and then rebuild!!! Unless anyone can think of an easier way to do this?

So
10.3.101.98 should appear as 010.003.101.098

View 3 Replies View Related

Forms :: How To Do Math With Two Different Units Of Measure

Oct 30, 2013

I have a table with some prices that are charged by the pound and some that are charged by each.

tblPrices
ID 1 - 1.00 per pound
ID 2 - 1.50 per pound
ID 3 - 2.00 per pound
ID 4 - 5.00 each
ID 5 - 7.00 each

My form is set up so that way I count how many containers I have and their weight, separately. I need ID 1 through 3 to do the math based on the pounds (essentially $1 per pound at 36 pounds) and ID 4 and 5 to do math based on how many of each are there ($5 each, and there are 3 of them).

View 14 Replies View Related

Display Remaining Units Within Time Frame

Jan 4, 2013

I have a database being used to track and bill therapy units. I have a table that stores the pre-authorizations that tells me within a [start date] and [end date] I am limited with X amount of units (that is all the client's insurance and/or funding source will pay for within the time period). I also have about 4 different codes I can be authorized for which is also stored in this table - each code a separate pre-auth record.

Another table is where I enter in the type of therapy (service code) I've completed with the client. I put in the Service date, start time and end time and it will automatically give me the amount of units to bill (1 hour=1 unit). If I happen to choose a code or enter in a service date that does not match up with a client's pre-auth (Service date is between start date and end date and matches code from pre-auth table) I have a simple text box that says "No auth for this code or service date" due to an IIF statement in a query. I'd like to take this a step further and give me the remaining units for the pre-authorization left when it does find a match.

What is happening is when it finds the authorization, it's not taking into consideration all the services I've done for that time frame. For example: I have a pre-auth from 12/1/12 to 1/31/13 for code 90806 for 12 units. I served the client for that code a total of 10 units thus far. I can't figure out how to link my 4 service records dated 12/3/12 (2 units), 12/16/12 (4 units), 12/27/12 (2 units), and 1/3/13 (2 units) to add together and then subtract from my auth for 12 units. I know the dates are the key but I'm lost.

View 3 Replies View Related

Hi - My Job May Very Well Depend On This.

Nov 1, 2006

I'm new to database designing, and my first project is to build a website and database for the proposal development department at my job.

After reading up, this is the design I've gone with:

Proposal Database

I know this is really complicated for my first project. There is a lot of many to many relationships that I'm not sure that I need. I've tried to normalize it as much as I could, but thought I would post it here to get professional opinions.

Also, is it possible to create a form that would update the junction tables between the make to make relationships? For example, if I wanted to add Criteria from the EvaluationCriteria table to the first Proposal in the Proposal table, would I have to go in and manually update the Proposal_Evaluation table each time?

Any help would be greatly appreciated.

View 5 Replies View Related

2 Comboboxes, The Values On The Second One Will Depend On The Value Of The First One.

Mar 14, 2006

Hi,

I have a problem and I need any help I can get!

I have a master form (MasterForm) and a subform (SubForm).

in the SubForm I have 2 comboboxes (Institution) and (Office).

Each Institution has a number of Offices.

What I want is:

Based of the Institution the user choose, the offices that belong to this instituion will appear in the combobox.

How can I do that?

Regards,
CS.

View 6 Replies View Related

Howto: Second Combo Depend On Value From Another

Aug 22, 2007

Dear all,

I am trying to do the following on a form:

field "A" is a combobox listing filed from a table (Field= CustomerName, Table=Customers).
filed "B" is a combobox that have to list filed Contact.Name where Ciontct.CompanyName = <companynmae selected at te first combobox>. What is the field name containing the value selected in the first combobox? How to write a SQL that workds?

Thanks for your help.
Itschak.

View 1 Replies View Related

Dropdown List To Depend On Other Field

Mar 15, 2008

I'm trying to set up a database of books in a small library - each book has a prefix (Maths, English, Art etc) which I want users to be able to pick from a drop down list - I can do this, but the next field is a sub-category - is there a way of populating the dropdown list for the sub-category field depending on the chosen entry in the prefix field. eg if maths was chosen I would like the user to have the choice of number area, volume etc. but a different choice if the prefix was English.

any help very gratfully received - it seems to be a simple problem but it has me stumped.

View 14 Replies View Related

Forms :: Subtract Value From Combobox Depend On Value In Other?

Feb 22, 2014

i want to substract value in combobox, but the source of the other combobox is in other table then Form query shows. How can i do that?

View 3 Replies View Related

Forms :: Make One Combo List Depend On Another

Sep 24, 2014

I have a combo: cmb_TrainingType. The sql is:

Code:
SELECT tblTrainingType.TypeID, tblTrainingType.Type FROM tblTrainingType ORDER BY tblTrainingType.Type;

My second combo (the one that should be filtered based on the Type chosen above) is cmb_Project_Title. The sql I have written (which isn't working) is:

Code:
SELECT tblCourseDetails.CDID, tblCourseDetails.Project_Title FROM tblCourseDetails WHERE (((tblCourseDetails.TypeID)=Forms!frmResourcing.cmb_Training_Type) And ((tblCourseDetails.Type)=Forms!frmResourcing.cmb_Training_Type)) ORDER BY tblCourseDetails.[Project_Title];

Both of the tables that are referenced have the fields TypeID and Type.

View 1 Replies View Related

How To Make A Table Lookup Field Depend On Value In Another Column

Sep 20, 2012

I have a table called Locations that lists Countries and Cities:

USA, Detroit
USA, Chicago
USA, New York
UK, London
UK, Liverpool
UK, Birmingham
France, Paris
France, Le Mans

I then have another table for inputing details on people I know. This table would have columns called Country and City. I've figured out how to make the Country column a "lookup column" so that I can only enter USA, UK or France. But how do I make the City column show only the appropriate list of cities relevant to the country that I've selected (e.g. Paris or Le Mans if France is the selected country).

View 5 Replies View Related

General :: Creating Dynamic RibbonXML Where Statement Will Depend On User

May 17, 2015

creating dynamic RibbonXML where statement will depend on user that is accessing access database. I created DynamicXML no problem and it changes context depending on user but my main problem is refreshing ribbon. I see that UsysRibbons tables changes fine but it's not being loaded. I have to restart access in order to this to take effect. I tried gobjRibbon.Invalidate method but it doesn't refresh ribbon for some reason... Here is my code:I created new module with name "Ribbon" and put this in there:

Option Compare Database
Option Explicit
Public gobjRibbon As IRibbonUI
Public Sub CallbackOnLoad(Ribbon As IRibbonUI)
' Callbackname in XML File "onLoad"
Set gobjRibbon = Ribbon
End Sub

and then in form that validates a user I put:

If (Not gobjRibbon Is Nothing) Then
gobjRibbon.Invalidate
End If

View 7 Replies View Related

Built The Databse...What Is Next?

Mar 22, 2006

Hello Everyone,

I just finished building my database and i have to install it on a PC. my problem is how to remove access tool bars and menues so that the only thing that appears when you open the databse is the login screen?
I don't want the user of the database to be able to go to design view and change the design of the forms or the reports. I want the user to see and be able to interact with the login form and the switchboard.
I wanna also know how can i install the databse on the PC. do i just copy it and paste it or is there any way else?

I hope you understand what i want.

Thanks in advance for your much appreciated help.

View 6 Replies View Related

Built In Functions?

Aug 8, 2007

Does anyone know of a good resource to mull through all of the built in functions and learn their syntax, uses, etc?

Thanks

bluke

View 2 Replies View Related

Allow Built-in Tools Bars

Aug 2, 2007

Hello,

I created a database, and was trying to get the welcome form, to load full screen. So I unchecked all Menu bar and Shortcut bar (allow)

So I now have locked my self out.

Any ideas, I once remember something like ctrl while opening the database, but that does not fix it.

Thanks,

Ranger

View 3 Replies View Related

Built In Functions Not Working

Feb 25, 2008

Hi, I have a database in Access 2000 format that runs just fine on my work PC which is running XP Pro and Access 2003. When I run it on my laptop (Vista Ultimate and Access 2002) I have a problem where it doesn't recognise the Mid function (or Left, right etc...for that matter). Everytime I try to run the query I get an error 3085 Undefined Function 'Mid' in Expression. Other databases work fine, it just seems to be this one. Can you please explain why this is happening and how I can get around it. Cheers

View 3 Replies View Related

Hiding The Built In Menus

Mar 15, 2008

Hi

I went into tools, startup and unchecked allow full menus. Now when I open the DB, I don't have the tools menu so I can check the allow full menus. I need to get this back so I can continue working on the DB. There must be someway to get this back/reverse it.

Access 2003

Thankyou

Garry

View 2 Replies View Related

Using 2007 To Run Database Built With 2000

Mar 31, 2008

I built a ms database and I'm just wondeirng about the compatability of using 2007, what kind of issues can i expect to run into and does this sound like there will be a major overhaul needed in the programing, or should it be pretty straight forward.

View 1 Replies View Related

Removing Built In Form Views

Jan 25, 2005

I am trying to remove the built in form views from access 97. Is it possible to remove the navigational functions of the form while in view mode (ie first record, previous record, search, next record, and last record)? There is also an arrow bar that has no functionality to it placed at the left side of my forms that I would like to get rid of. Is this possible? Thanks for your help!

View 4 Replies View Related

Change Backcolor Of 'built' Control Number

Dec 20, 2005

I have a randomized table named tblRandomBoxes with the following data:

ID RandomID
1 4
2 5
3 2
4 6
5 1
6 3

I have 6 command buttons named command1,command2,command3, etc. and 6 Labels named Label1,Label2, Label3, etc. On Click of each command button, I want to lookup the ID based on the RandomID and set the backcolor of that label number to a different color.

ie) on command1 click me.Label4.backcolor = 39835

How can I 'build' the label number with the lookup? Here's the code I'm trying, but it doesn't recognize my 'built' label number:


Private Sub command1_Click()
Dim ctl As Control
ctl = "Label" & DLookup("ID", "tblRandomBoxes", "RandomID = 1")
Me.ctl.BackColor = 39835
End Sub

Thanks,

Sup

View 6 Replies View Related

Forms :: Built-in Search Function With Combo Box

Aug 6, 2013

I have a combobox on a form that lets the user select a business name which then populates the rest of the fields in the form appropriately. But when it does this it makes it so that the seach function at the bottom of the screen no longer works, as it only has the selected record as an option. So before selecting a name from the drop down list at the bottom of the screen is says "Record: 1 of 5" but after selecting the name it become "Record: 1 of 1." Is there anyway to still allow the built-in search function to work alongside using a combobox?

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved