How To Automatically Update A Table Field From A Form?
Feb 19, 2006
hi there
I am having some difficulty with using Access (aren't we all?) ;-(
I have a table with a the following fields: START_DATE, END_DATE, RENTAL_PERIOD, DAILY_COST & TOTAL_COST.
What I am tring to achieve is that when someone fills in the START_DATE, END_DATE & DAILY_COST fields (which update the table behind the form) that the form will take the END from the START and put the result into the RENTAL_PERIOD field and then multiply this by the DAILY_COST value to automatically fill in and display the TOTAL_COST field.
It must be simple but I just can't get it to work and it's stopping me from sleeping :mad: I have found myself doing Access in my dreams which is not good!!
Any tips much appreciated - Thanks
Mike
PS I have written 2 queries which will calculate this for me but dont seem to be able to action the queries from within the form (if that helps!)
View Replies
ADVERTISEMENT
Jan 14, 2013
I have two tables, one called 'Company' and one called 'Person'. Both tables have several fields, but they both have the same primary key, i.e. 'Naam'.
When I type in a name in the 'Person' table, I'd like the 'Company' table to automatically display the name too. So for example if I type in 'John Doe' in the person table, I want to be able to switch to the 'Company' table and have the same name displayed there, automatically.
View 1 Replies
View Related
Jan 8, 2015
I'm a maintenance coordinator for a small trucking company and I'm putting together an access database to track and manage all of our fleet maintenance. I'm rank amateur when it comes to access but I've been doing ok with it and so far I've been able to get it to do almost everything I set out to have it do.
But I'm having a hard time figuring out how to make this trick work. Here's what I want it to do. We have two groups of trailers, working trailers and storage unit trailers. We do preventative maintenance every six months on road trailers and once a year on storage units. I have a field in tblEquipmentMaster which shows the last PM date. I have a query and an report which use that LastPMDate field as well as the value of a StorageUnit checkbox to calculate what units are due/overdue for PM.
In addition to all this, I've got tables and forms set up to track maintenance records. I'm tracking the maintenance invoices as well as the details of each line item on the invoices (changed water pump, replaced tail light, PM service etc). So what I'd like to have happen is for the LastPMDate field in tblEquipmentMaster to update to the value in InvoiceDate in tblMaintenance anytime the field Description in tblMaintenanceDetails contains the text 'PM' for the unit number in question. Alternatively tblMaintenanceDetails also has a lookup field which contains maintenance codes. So the field VMRSCode could also be used as the trigger anytime the value 'PM' is selected.
View 3 Replies
View Related
Mar 18, 2015
I have a form and a subform
Which method should I use if I need to update automaticaly a field in form based on an event in subform ?
Just to be more clear, have a look in the below example.
In first print screen, student "Johnson Nick" has not completed all tests in TestA subform, the form field "DateCompleteA" is blanc.
Once a student completes all tests in Period A, I need the form field DateCompleteA to show the date that he completed the last one. (18/3/2015).
If student has not yet completed all tests in TestA subform the Form field DateCompleteA must be blanc.
Student has not completed "literature"yet, DateCompletA field is blanc
Student completed ALL his test, subform is updated, Form field DateCompletA is updated with the maximum date.
View 3 Replies
View Related
Sep 12, 2006
I am currently handling an insurance operation. I have 5 Sales Executives (SE) who receives certain percentage of commission for each sold insurance policy. SE receives their respective commission on a pro-rata basis. Meaning, if they give 4 equal monthly payment scheme to their clients, they will also receive their commission -- 4 times.
Example:
SE Commission for one sold policy is: 100.00. (Granted SE gives 4-month-term, SE will be receiving 25.00 monthly, upon cleared payment)
On my 2 tables lies the following fields:
[Table1]
SECom1
SECom2
SECom3
SECom4
[Table2]
CustPayment1
CustPayment2
CustPayment3
CustPayment4
Is it possible to automatically update Table1.SECom2 based on the figure on Table1.SECom1, once Table2.CustPayment2 is updated?
Thank you!
Sheila
View 2 Replies
View Related
Jul 22, 2014
I'm fairly new to using Access for any serious purposes. I'm trying to replicate some database functionality I setup in Salesforce and just trying to clear few core concepts in Access.
I'm messing around in the Contact Management template and I'm wondering how I can make it so when so when a yes/no checkbox field (called "Active") is ticked a date/time field (called "Last Date") is automatically set to today's date + 60 days.
In Salesforce I would create a Workflow Action triggered by an if Active = true statement, with a Field Update something like TODAY() + 60.
I can tell I need to create an After Insert/After Update Data Macro but can't quite figure out what to put in.
View 11 Replies
View Related
Aug 17, 2012
I have one DB that is used for creating/storing customer ID's, and another DB that is used for creating/storing job information for customers.I have linked the table from the customer DB to the job DB.
There is a table in the job database that holds customer name and ID, and some VBA that generates unique job codes.
Is it possible to have the data from the linked table automatically update into the existing table?
View 1 Replies
View Related
Oct 24, 2005
Most likely a newb question, but how can i just update the date/time field to the current date, as opposed to constantly entering in the current date?
Thanks
View 1 Replies
View Related
Oct 30, 2012
I have a table called Inventory (table1 - PK=INVID) that contains all inventory ID numbers and descriptions. I have another table called Inventory Transactions (table2 - FK=INVID) that gets updated through a form. When a new transaction is made in table2, I want the transaction amount to get added or subtracted to an OnHandQty field in table1. I tried having table2 (transaction table) as the main form and then table2 as the subform, but I couldn't get table2 to update.
View 5 Replies
View Related
Jan 29, 2015
I am using Access2007. Attached is my database.
I am attempting to track the duration of days since an initial date.
A individual has 3 business days to have their bloodwork/labs drawn after given instructions to do so. 'StartDate'= the initial date. 'LabsDate'= current date(would like it to automatically update to the current date everytime the database is open). BD ElapsedLabs= # of days that has elapsed between the initial day and todays date.
I am able to calculate the #days elapsed no problem, but I am having a problem with 'LabsDate' automatically updating to todays date. I am able to automatically place the current date in the first/ fresh entry, but it fails to update the next day.
I have tried placing the code Me.LabsDate= date() in the Before Update Form Property Sheet. Cannot get it to work.
View 9 Replies
View Related
Aug 17, 2006
Group,
I thank you in advance for considering this inquiry.
From within a Form.field (based on a master table query), I desire to trigger two events; one before update and one after update.
This function will serve to document specific form.field value changes to a "log" table for review prior to being committed back to the master table.
What I'm looking for are functions, which I can use in a Macro or VBA code to facilitate a field read and copy before change and a read and copy after change triggering.
I'm sure this is absurdly simple.
View 2 Replies
View Related
Aug 6, 2015
I created two tables, let's refer to them as Cars (VW, BMW and Audi) and Colours (White, Black and Grey).
Is it possible to create another table based on these tables - i.e. in the new table the rows will be the Cars and the columns the Colours as such:
White
Black
Grey
VW
BMW
Audi
And should I enter another Car or Colour in one of the first mentioned tables, then I would like this "new" table to update automatically. For example, if I have a new Car (say, Merc), then I would like the "new" table to update to the following:
White
Black
Grey
VW
BMW
Audi
Merc
View 2 Replies
View Related
May 10, 2013
I am hoping to create a field name in a query that will change every month. Right now the filed name is qryTechQuintileMonth-7.am_quintile. this designates that the data is for October 2012. There are 6 other fields named similarly for Nov 2012 through April 2013.
Is there a way to name these fields with the proper month-year (mmm-yy) so they automatically update each month?
View 4 Replies
View Related
Mar 13, 2013
I have one field AccountName in customer table and another field AccountID.
In my form I would like to select from the combo box AccountName during data entry and then have the AccountID automatically update in the Account ID field.
View 2 Replies
View Related
Feb 25, 2014
I am giving two tables and I need to create a macro that automatically updates these tables depending on the value of a Yes/No field. If it's No, it's in the 1st table TableOne, if it's Yes it automatically updates to TableTwo.
So, the best way I saw to go about is to set up an append query and then create a macro that runs it
So my tables have the values FirstName, LastName and isValid (more but keeping it short)
So for my append query, I put TableTwo in the pop up I get. Then, where it asks for the field I put it
Field:FirstName
Table:TableOne
AppendTo:[TableTwo].[FirstName]
Criteria:[TableOne].[isValid] = 1
I do this for all (it was autocompleted except the Criteria field). I tried to keep Criteria with data only for isValid but that didn't work. I wrote it for all the field names, still didn't work. Whenever I click run it says it'll append 0 rows.
View 5 Replies
View Related
Aug 5, 2014
I have a table products with a field "id_product" and "total" (Total items in stock)
I have a query with the fields "id_product" and also the field "total in stock"
I want an update query to update the field 'total' in table 'products' with infos from that query
For each id-product in table products, replace the field total with the field 'total in stock' from the query
So I want to update a filed in a specific table with infos form another table.
View 2 Replies
View Related
Aug 3, 2006
I have a couple of drop down menus on a form i have designed which have values which are dependent on another drop down.
So, for example, when i select USA in country, the US$, appears in my currency box but i have to select US$ from the drop down when i want it to appear automatically.
Any ideas on how to do this?
Cheers
Also, i have a calcualtion attached to a text box:
[Text87] = (1 / [List93]) * [Combo85]
However, the calculation will not be performed, even on click, until [List93] has been clicked on. [List93] is a constant value and is a hidden field so how can i make access perform the calculation without clickin [List93]
Many thanks in advance
Cheers again
View 2 Replies
View Related
Oct 7, 2013
I would like to update the Previous Education tab based on values on the Courses tab.The aim of this is to keep a clients previous education upto date in order to append it to a CV etc.
View 4 Replies
View Related
Apr 6, 2006
i have a form, which is based on query from multiple tables.. in this form i want to add a unbound textbox in the detail section.. whenever a user leaves this records, the system should insert a record in another table with values from this record including this field... how to do this?
the record is from a query where as the field is unbound, still we need to insert the values from record and this field at the same time into another table..
example: i have item master and item production table.... from joining these table i get a query which will give me item A and prod qty .. when i use this query as form datasource, the detail section has these two fields.. now i want to have an unbound field budget.. so i have the followig in detail sectin
item A production qty budget qty
when users enter values in budgetqty field and moves to next recod,, the system should insert into another table xyz values (itemA, production qty, budget Qty)
how to do this..which event will be good.
urgent reply is expected.
View 2 Replies
View Related
Dec 2, 2014
I am working on a shared database. There are two tables in the database.Table1 have all the employee personal information like employee ID, name, nationality, date of birth etc whereas Table2 have the salary information like Basic, HRA etc. The two tables are joined by Employee_ID field.
I have created two forms, Form1 is only based on Table1 whereas Form2 have fields from both Table1 & Table2. The issue is that if I use to enter the data using Form1, the employee_ID is not automatically updated in table2. On the other side If i use to enter a data by using Form2 then everything is working fine. Is there a way to update a field value which is not in form?
View 1 Replies
View Related
Oct 12, 2006
I've read over and over that calculated data is bad, that's fine with me... but here is my dillema...
I have four fields that interact with my calculation in a single form. There is only one table in the database.
AmountF (The stored data in the table) (amount financed)
FC (calculated by =[amountf]*.25) (finance charge)
Amount Paid (used in calculation of total due)
total due (calculated by =[amountf]+[fc]-[amount paid])
The math already works, everything works. I can choose to print the form and it looks great. However, I would like for it to (when I'm done printing the form) somehow save the total due data to the AmountF column in the table. AmountF is in the same line as all the other information, so I would like it to not create a new record just update the old one.
All four of these fields have a text box in the form for themselves.
View 4 Replies
View Related
Jul 6, 2013
I am attempting to create a patient tracking database for a clinic I work in and I am stuck at one small but major part.
I have a parent form called frm_Patient_index. On this form you can enter patient details such as personal details, observations ect. I need to create a lab request form for certain tests to be performed.
I want so that a button on the frm_patient_index form opens a subform where the relevent tests can be requested via tick boxes. Now here is my problem I have managed to create all of that except for the information to be entered into the frm_lab_request automatically and get SAVED to its corresponding table. It will not save for me.
I can get the information such as Badge Number, First Name, Surname and DOB to all enter into the fields automatically but getting them to save to the table is not happening.
View 3 Replies
View Related
Dec 4, 2013
How to do an UPDATE using VBA on a form to update a specific record on the table using an unbound field on the form to filter the update.
Every time the code runs, it tells me: Run-time error '3144': Syntax error in UPDATE statement and takes me to the "CurrentDb.Execute strSQL, dbFailOnError" line at the end of my sample below.
Here's my code:
Dim strSQL As String
Dim strCriteria As String
strSQL = ""
strSQL = strSQL & " UPDATE [tblTicket] SET"
strSQL = strSQL & " ([UpdatedBy], [AssignedTo], [Requestor], [Dept])"
strSQL = strSQL & " Values"
strSQL = strSQL & " ('" & unbEnteredBy & "','" & cmbAssignedTo & "','" & cmbRequestor & "','" & cmbDepartment & "')"
strSQL = strSQL & "Where [tblTicket]![DateTimeOpened] = #" & FORMS!frmTicketTracker.unbDateTimeOpened & "#;"
CurrentDb.Execute strSQL, dbFailOnError
View 9 Replies
View Related
Mar 17, 2012
I have a form, which i use to book in products received. What i want to do is if the quantity received is equal to what was ordered then i'd like to update a yes/no field (Order Complete) on a separate table to true.
View 8 Replies
View Related
Mar 14, 2008
I have a table which contains these fields
MAIN TABLE
Job_No - Looks up Job table
Source - I want this to be automatically filled from the record associated with the job number from the Job table
Test_Result - Looks up Result table PASS/FAIL etc
Technican - Looks up technican names table
JOB/SOURCE TABLE
Job_No 0001 0002 0003 0004 etc
Source Cust1 Cust2 Cust3 Cust1 etc
Note also that we also have different job numbers for the same customer
I know I can fill in a value on a form from a combo box looking up another table but dont know how to do this in the main table
Any ideas?
Paul
View 7 Replies
View Related
Aug 12, 2005
I have two tables, each has a "status" for a project. In the first table there is only one instance of each project name, in the second table there may be more than 1, will always have the same name but may have a different "Status" (field).
I need the Status field of the first table to be set to "Assigned" if ANY of the records in the second table pertaining to that project are set to "Assigned".
Can I do this with my table or will I need to do it with a query/form combination?
Thanks,
View 4 Replies
View Related