Modules & VBA :: Calculate Same Date Multiple Times

Sep 20, 2013

At the moment I am working a little project at work and am stuck on how to calculate departments due date based on actual order due date.

example:

OrderID: xxxxxx-xx DueDate: 10/8/13

Now let say i have 5 different departments but I want/need to know what should be the due date for each of those departments based on the due date on top.

View Replies


ADVERTISEMENT

Modules & VBA :: Calculate Period Between 2 Times

Feb 8, 2015

I create form to calculate the difference between clock-in time and clock-out time, what is the code to do that

I have 2 fields :

field 1 name clockin
field 2 name clockout

I have a text box to display result equal the period between time1 and time 2...

View 7 Replies View Related

Modules & VBA :: Running Queries Multiple Times In VBA

Dec 10, 2014

I have a situation where I am using a maketable query to create a table and then I need to use append queries to then add additional records to the created table - some of these are just run once and some multiple times.

if possible, I do not want to hard code the query multiple times i.e.

Code:
DoCmd.OpenQuery "qryCreate_1"
DoCmd.OpenQuery "qryAppend_1"
DoCmd.OpenQuery "qryAppend_1"
DoCmd.OpenQuery "qryAppend_1"

etc

So is there a way I can run the make table query and then get some sort of loop to run the append query a number of times ?

View 4 Replies View Related

Modules & VBA :: Command Button Press Multiple Times Based On Value In Text Box

Jul 23, 2015

Is there any way to press a command button a certain amount of times based on a value in a text box.

i.e.

text box value = 5

button gets pressed 5 times with one click...

View 14 Replies View Related

Modules & VBA :: Text Field In A Form Updated Multiple Times When Filter Is Applied?

Sep 9, 2013

In my Access 2010 database there is a form with a large number of checkboxes enabling me to select/deselect certain record details.

Each click on one of the checkboxes triggers a VBA routine setting true/false values in one of several tables linked to the main table.

A query over all records is filtered by the true/false values of the linked tables and the resulting set of records is displayed in the (continuous) form.

The header of the form contains a text field with the value "=GetRecCount()" displaying (correctly, but randomly fast) the number of records selected:

Code:
Function GetRecCount() As String
Dim NumRecs As Long
Dim rs As Object
On Error Resume Next
Set rs = Forms![Super Search].RecordsetClone
rs.MoveLast
NumRecs = rs.RecordCount
Set rs = Nothing
GetRecCount = Format(NumRecs, "##,###")
End Function

Now, the funny thing is that each click on one of the boxes results in 1 call of the VBA routine setting table values, but 21 calls (!) of the text field "=GetRecCount()" in the form. I have established this by incrementing a public variable at each pass.

Why a field in a form is updated 21 times when a filter is applied?

View 4 Replies View Related

Modules & VBA :: Copy Record N Number Of Times - Incrementing Date

Jun 3, 2015

Is it possible to copy a record 'n' number of times, incrementing the date by either days, months, weeks etc?

I have a regular payments table that will need to be edited at some point should either dates, or amounts change, but... regardless of the size of the table, it's not a problem, as these will be moved to a different table and deleted once paid.

Given the example, would it be possible to copy this record and additional 5 times, incrementing the date by one week.

View 11 Replies View Related

How To Calculate Times Across Midnight.

Jan 15, 2007

Calculate time across midnight in ms access
--------------------------------------------------------------------------

Hi,

I have created a database to store patient arrival date, arrival time and departure time.

I am trying to set up a query to calculate the total waiting time for each patient from arrival time to departure time.

At the minute I can calculate the total waiting time in minutes by:

Minutes: DateDiff("n",[Time Arrived],[Time Left Department])

and the total waiting time in hours and minutes by the following:

Waiting Time: [Minutes]60 & Format([Minutes] Mod 60,":00")

But this does not work accross midnight, as it gives a negative time for anyone seen before midnight and discharged after midnight.

Any help much appreciated.

View 3 Replies View Related

Modules & VBA :: Calculate Age From Birth Date In Years

Apr 19, 2014

I have this code for calculating the age from birthdate but i want if there is years no months or days appear

Public Function CalcAge(Birthdate As Date) As String
Dim intYears As Integer, intMonths As Integer, intDays As Integer
intMonths = DateDiff("m", Birthdate, Date)
intDays = DateDiff("d", DateAdd("m", intMonths, Birthdate), Date)

[Code] ....

View 4 Replies View Related

Modules & VBA :: Selecting Date Range And Calculate A Sum?

Aug 8, 2013

I want to select a date range from "Production" table where it agrees to the Dept_ID too. And then calculate the summation of the columns "hours", "produced" & "waste" of that particular range selection.

This is my code:

Code:
Option Compare Database
Private Sub cmdCal_Click()
Dim sql As String
Dim rs As Recordset
Dim qdef As DAO.QueryDef
Dim hours, waste, produced As Integer

[code]....

But it returns nothing, When i remove the errorHandler, it says that no records were found.

View 2 Replies View Related

Modules & VBA :: Calculate Part Information Difference As Per Date?

Nov 21, 2013

How to implement a functionality into my access database. The related tables required for this functionality can be found as an attachment.

When the information has been entered into the tables by the user, I would like to calculate the difference between the information for each part within the same table. The main columns for which the difference have to be calculated are: [RefObsInfo->RefSources] and [AltObsInfo->StatusAltSource] and [GenObsInfo->GenSources]. The values for these fields are restricted to 3 or 4 different ones. I also would like to show if the GenEstAvailable columns are changed, but that's for later.

In order to calculate this difference a query has to select for each Part the information related to the last date AND a date which has been specified by the user (with the previous date as max). For this the user is asked to give a from date, which she/he can select from a combobox. This combobox has a standard selected value which is the MaxDate-1, i.e. the previous date. The difference should be calculated from the previous date to the last date. I would prefer to give each (predefined) difference a specific action to show the user the difference in a matter of seconds.

View 13 Replies View Related

Asking Me For The Same Info Multiple Times

Feb 9, 2007

I am really new at access 2003 and queries s forgive me if this question is really dumb/simple/confusing...here goes

I created a query where I ask the user to provide the info for the date range..<[Before date]

it worked fine.

I then added something to the database and ran it again and it now asks me for my date not once, but twice..i then copy and paste query with a new name and it asks me for the same info 4 times

Help me please..Thanks

View 2 Replies View Related

Combo Box - Using Multiple Times

Sep 7, 2006

Hi again everyone,
With help on my first question Ive now got my cascading combo boxes working to a stage that shows all the information I need,

Currently Ive got 4 cbs and they work bring in and updating depending on what is selected in the previous etc etc.

combo1 = 2
combo2 = 5
combo3 = null
combo4 = null

how can I tell it to use combo2 since there is no values selected in 3 and 4

Ive currently got the combo boxes in a form of their own, basically in my main form Id like to be able to click on a button to update a value, and then it will bring up the form for the combo boxes, then id select the values till I had what i needed, and then it would fill in the value on the main form with my selection from the combo boxes,

to make it abit harder, on the main page, there is 3 values that will need to get their value from the combo boxes, will that just mean I have to make 3 forms with the combo boxes in them, one for each of the values on the main page, or could I just have one form and maybe put a button saying (Use this Selection for Value 1)(Use this Selection for Value 2) etc etc.

Ive looked through the net alot and cant seem to find any examples that suit my question... but if anyone knows of a good example that would be awesome.

Cheer Ezy

View 8 Replies View Related

Automaticaly Run Query Multiple Times

Jan 24, 2008

hi
I've got a series of analytical data tables and queries setup.

one of the queries will do a length weighted average based on a user input FROM and TO distances, this query works fine and produces a report.

What I have is a table that contains a list of m FROM TO distances,

rather than picking them one at a time I'd like to set up a report that would get the FROM TO info from the Table, call the query and report each of the FROM TO distance averages on a line in the report.

What's the easiest method to use to set this up. any code snipets would help to get me started and any help greatly appreciated.

View 2 Replies View Related

Record Entered Multiple Times

Mar 12, 2008

Hello All,

I am creating a database that is supposed to capture the employee's type of work, time it takes to do the work, etc...

So far, it does what it's supposed to do but my record's are all over the place.
E.g. i have tables called:

tblDailyActivities - this table is supposed to store all record without sorting.

tblemployees - this table is supposed to have a list of employees and when maximized, all records associated to that particular employee should be listed.

However, the i have right now is that instead of listing it under the particular employee, it lists the employee's name individually for each item listed.

What i want is to for the tblemployees to be listed like tblfunctions.

see attached database since i probably am not making any sense right now.

Thank you,


John

View 9 Replies View Related

Parameter Prompting Multiple Times?

Aug 15, 2011

I have a report with a subreport. I have added a parameter to the query to prompt for [manager] or is null to get all managers. However, on the report when I enter a manager my count on the subreport still returns the count for all. So, I added the same prompt to the query for the subreport. It returns the right count, however, it prompts for the manager multiple times. How do I get it to prompt only once yet get the right total?

View 1 Replies View Related

Comparing Multiple Dates And Times In A Query

Mar 8, 2007

Hi there,

I'm trying to 'rank' x5 categories that overlap. To determine the ranking i'm utilising date & time (if the dates are equal). I've managed to do this comparing x2 of the categories but struggling with the logic for x3,x4 & x5 categories

I have the data in separate tables by category date & time and in one large table.

Hoping someone can assist as my head is starting to hurt.

Thanks

View 4 Replies View Related

Add A Single Field Multiple Times In A Form

Oct 3, 2006

I hope someone can help me on my problem below:-

A user wanted to key in the data in a single form where she can select where
a particular procedure is located. The procedure could be duplicated and
placed in a few departments.

My tables are as follows:-
tbl_Proc_Dept:-
ProcNo - Text (Primary)
TrgConducted - Yes/No
DeptAbbv - Text (Primary)

tbl_Dept:-
DeptAbbv:- Text (Primary)
DeptDetails:- Text

I created a form where i have the following fields in the form:-
1. ProcedureNo - Text
2. TrgConducted - CheckBox
3. MainDept- ComboBox (DeptAbbv data field)
4. Finance – CheckBox (DeptAbbv data field?)
5. Admin – CheckBox (DeptAbbv data field?)
6. Purchasing – CheckBox (DeptAbbv data field?)
7. Facilities – CheckBox (DeptAbbv data field?)
8. MIS – CheckBox (DeptAbbv data field?)

How can I add multiple deptabbv field in a single form?

Pls help.

Thanks.

View 1 Replies View Related

Prompted Multiple Times For Query Criteria

Sep 27, 2006

I have a report that is based on a query. In the query, I have it prompt for a criteria for a field. It prompts for the name of an event, so only the participants of that event are displayed.

Also on that report, I have a subreport, which is based on that same query, but returns different data.

My problem is that since both the main report and the subreport are based on the query that prompts for input, it's prompting me multiple times for the same input when I view the report.

Is there a way to have Access use the same prompted input for both reports, so I don't have to enter it more than once?

View 1 Replies View Related

How To Specify Relationships When Two Tables Are Linked Multiple Times

Nov 16, 2006

Hey all, i would appreciate some help with Access here.

I am an attorney, and i am trying to set up an access database for all of my cases.

I have one table in which i keep the names, contact information, etc of all the witnesses who i have used or will be using (especially expert or law enforcement witnesses who i will be using in multiple cases).

I also have a main table in which i have a record for each case. Because I have multiple witnesses for most of my cases, I have had to create multiple relationships between my main cases table and my witnesses table.

My question is this: How do I specify when setting up a report (or a form/query/etc) that when i ask for the witness's address i am looking for the address i made with a particular witness, specify that relationship between the two tables, as opposed to the other relationships between the same two tables.

I hope that makes sense, and i would very much appreciate if someone could give me instructions.

Thank you.

Jay B

View 1 Replies View Related

Reports :: Can't Pull Up Report Multiple Times

Jun 14, 2013

Here is my delima, I have a report that I am able to type in a keyword and it will pull up that report exactly as I type the keyword, however, let's say that I want to pull up someone else's report I cannot. I have to exit out of my report and then go back into it and resubmit the new search.

View 13 Replies View Related

Reports :: Requesting Parameter Multiple Times

May 29, 2014

I have created a query with parameters and a report from the query. The report is requesting the paramater multiple times but the query is running fine. How to resolve? Again, the query requests the parameter once but the report multiple times (6x).

View 3 Replies View Related

Reports :: Subreports Print Multiple Times

Dec 23, 2013

I've narrowed my problem to a subreport that prints multiple copies of the report based on the number of items generated in the subreport.

i.e. If I have an instructor registered to teach three classes in the subreport, the main report will print three time (identical). An instructor with two classes will print twice (identical).

No button...just good old "print" how? why? where?

View 3 Replies View Related

Reports :: Parameters Being Requested Multiple Times

Nov 17, 2014

I set up what I thought was a simple query in my DB using it to create a report containing a subreport.

I kind of works, however Access is asking me for the parameter value [Extract Date] multiple times, when in theory it should only ask once!

In addition (and likely related) the Access is then repeating the output multiple times.

View 8 Replies View Related

Calculations Between Date And Times

Mar 8, 2007

Hi,

In MS Access i'm trying to calculate the difference between one date time to another. for example

26/04/2007 09:00 am
07/03/2007 10:30 am (Current date time)

This should work out the:

days
hours
minutes
seconds

I did want this to be shown on a form

Thanks

View 2 Replies View Related

Querying A Table Multiple Times Based On Output

Feb 12, 2006

Hi,

I need to run a parameter query in which you enter a product number and the query (a) returns the list of components and (b) then automatically reruns the query for these components. In other words, I enter an input (a product number) the query gives me outputs (component numbers) and then reruns the query with each of these outputs as the input (i.e. I want to know what are the sub-components of these components). This process stops when all the components are raw materials -- this will be easily identifiable.

Does anyone know how to set-up this type of query?

Thanks!

Andre

View 1 Replies View Related

Subform's On_current Event Runs Multiple Times

Oct 20, 2005

I'm trying to clean up one HUGE and ugly form by using subforms within tabs. I have a main form with "BottleID" as the key field and linking field. The tab displays pictures based on the BottleID and it works like a dream. My problem is that the "on_current" event happens 4 times on each record. For instance, I go up a record and it sets Picture1.value 4 times and it's the same thing everytime.

I'm wondering if the problems is due to bad table design. Everything is located within one table and I'm really unable to change this. It's been like this from the get go and too much to change to break it apart. Anyway, the subform is pulling data from the same table. I thought maybe this was the cause.

I'd post the database if possible, however there are hardcoded directory's and will not work unless they are all set up. Not worth it IMO. Any ideas? I tried doing the BottleID = forms!frmMain!BottleID instead of the auto-link in Access but it gives me several errors and I don't believe it buys me anything. Thanks in advance!

View 3 Replies View Related







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