Form Event (Before And After Update) Copy Form/Field Value To Another Table/Field

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 Replies


ADVERTISEMENT

Modules & VBA :: Subform Event To Update Automatically A Field In Form

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

Forms :: Timestamp Record After Update Event And Copy Data Into Another Form?

Oct 2, 2014

I have a simple data entry form on which there are about 30 to 40 data fields to be update by users. One of the field is called "Stage" which is a combo box with 2 entries "Formal Case" and "Informal Case" with no default value whien a form is first opened.

Users will normally create a data entry which updates the table and save.

However if in future users open any one existing record and try to change Stage field from Informal to Formal or vice a versa I would then like this action to

1) update a time stamp concatinated with the stage change value in a text field perhaps

2) save/close the form

3) open a new form with all the existing entries(plus changed status of "Stage Field") with a new record ID and new time stamp.

View 1 Replies View Related

Update OnHandQty Table Field Based On Qty Field From Another Table / Form

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

UPDATE Query Copy Field To Another Table

Dec 7, 2006

Hi all,

I have two tables and one of them (table1) has two fields called
pct_id and pct_name.
table2 has the field pct_id.

I also created a new field in table2 called pct_name.
What i'd like to do is set table2.pct_name=table1.pct_name wherever
table1.pct_id=table2.pct_id automatically.

Is there a query that can check to see if its the same and update table2?

Heres what i tried but it didnt work


UPDATE table1
SET table1.pct_name=table2.pct_name
WHERE ((table1.pct_id)=(table2.pct_id));

Thanks in advance

View 1 Replies View Related

Forms :: Copy Value From Field In Subform To Field In Main Form During Data Entry

Jul 18, 2013

How can I get the value from a field in one table (in the sub form) to copy/insert into a field in another table (in the main form) when adding a new record?The main form and sub form are linked using parent/child linking, and the sub form is in a tab.I have table A (Visit Dates) in the main form which is used to record the date of a visit to a church. Table B (Quarters and Peals) is used to record an event that took place at that church during that visit. Note that not all visits in table A require a record to be created in table B - but half or more do.

In tables A and B I have a field called "QuarterOrPealID" and these are both primary keys, though the field in table B is set to 'no duplicates' and in table A it's set to 'duplicates allowed', as table A has its own auto number/pk. They are both linked in the relationships.

So, when I add a new record to table A using the main form, I might then need to click on the tab in the sub form to create a new record in table B, which has to be linked to the same record in table A. When the "QuarterOrPealID" auto number/pk is generated in the sub form (table B), I need that value to update to the "QuarterOrPealID" field of the main form (table A), so that when I'm viewing these records the form pulls all the information nicely together.

View 10 Replies View Related

1st Field In Copy Of Form Will Not Allow Moving To Next Field

Jun 27, 2005

Okay. I am certain that I am missing something real easy.
I have a somewhat large, form. I needed to offer users a similar form, but with a few field changes.

So, I copied the form, added the new fields.
If I work with an existing record and do not change the 1st field's data (idnumber), then no problem.
BUT if I try changing that idnumber or adding a new record, I cannot exit that 1st number.
There is no afterexit info for it or other issue that I can see. (But am I 'blind'?)

I appreciate any ideas.

Russ

View 1 Replies View Related

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 3 Replies View Related

Insert Into Another Table When A Field In Form Update

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

Forms :: Update Table Field Which Is Not In Form

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

Queries :: DSum - Update A Field In Specific Table With Info Form Another Table

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

I Need To Update Data In A Table With Information From A Calculated Field In A Form

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

Modules & VBA :: Update Specific Record In Table Using Unbound Field On Form

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

Update Field On Separate Table If Result From Form Equals Certain Criteria

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

General :: Update Main Form Field Value After Updating Field Value In SubForm?

Feb 12, 2015

I have a main form and a subform.

Both forms have the field called JobID in common.

Both forms have a field called JobStatus.

Any easiest solution so that After I Update the field called JobStatus in the subform, it changes the field called JobStatus in the main form to the value which was selected from the subform?.

View 3 Replies View Related

Update A Form Field By Double Clicking A Query Field

Apr 25, 2013

I have 3 peices of data that I am working with: Group number, plans and benefit elections. On my form I have fields for the group number and plan and 2 queries. When I enter a group number the first query displays a list of plan descriptions for that group. From there I can enter the plan description into the form's plan field and that runs the second query to give me a list of valid elections for that plan. This all works fine but I want to make the plan selection a little less tedious. What I would like is to be able to double click the query field housing the plan description and have it copied to the form's plan field. I could use the ID instead of the plan description but I work in a production environment and very key stroke counts so I would really like to have a simple double click process.

Is this even possible? If so how would I set that up? I tried using the double click on event macro builder but it does not seem to have this kind of option.

My form contains fields for group number and Plan. The same form houses 2 querys, one that pulls plans based on the group number and the other to pull elections based on the plan field (not the plan query). Would like to double click a plan within the plan query and have that description populated into the form's plan field.

View 6 Replies View Related

Forms :: Copy One Form Field From Another

Nov 4, 2013

I have form with the following fields

ID
Added by
Agent Name
Sign on
AgencyName
PCC
AgencyName (From another table)
PCC (From another table)

I need to copy the data from first AgencyName to second AgencyName and first PCCto second PCC

how can I do this with macro?

View 1 Replies View Related

Forms :: Copy Field In Form?

Jul 6, 2014

I have records that can be use several times and they dont change and record that change everey time. I want to be able to copy all records but also to locked older records to prevent users to change them.

View 14 Replies View Related

Forms :: Copy Value Of Text Field Into Another Form

Jul 8, 2015

My problem is that I want to copy the value of a text-field of form frmSnippet into another text field of form frmChange. But this is not possible, Access tells me that it can't find the form frmChange. But it's there, I checked the name.

My code looks like this:

Const cstrForm As String = "frmChange"
Dim strNr As String
If CurrentProject.AllForms(cstrForm).IsLoaded Then
DoCmd.Close acForm, cstrForm
End If
DoCmd.OpenForm cstrForm, WindowMode:=acDialog

txtSAPNr.SetFocus
Forms!frmChange![txtSAPNr] = Me![txtSAPNr]

Why I get the runtime error 2450?

View 5 Replies View Related

Copy / Paste / Rename A Field In Same Form?

Apr 25, 2014

In the Contacts database, in the Report Center form are 5 links on the right pointing to some default reports.I have created several more reports, and want to just copy-n-paste those links and then change the 'Tag' so it will point to my new report.Can you not just copy-n-paste a field within the same form?

View 5 Replies View Related

Forms :: Copy Field Data From Form To Subform

Jan 9, 2014

I have a form puling from one table and then a subform in that form pulling from another table.I have a field in the [FORM] called [GROSS REFUND] and a field in the [SUBFORM] also called [GROSS REFUND].I want the value of [FORM].[GROSS REFUND], if the value is not zero, to be copied into a new record on the [SUBFORM.[GROSS REFUND].

View 3 Replies View Related

Copy Field Data From Main Form To A Subform On Add New Record

Feb 25, 2006

I have a main form that has some sub forms on it linked by master child on PK. When I select a new record on the sub forms I want to take a date value from the main form and populate the value into a field in the sub form. How do I do this as I cannot see a new record event on the sub form?

help would be much appreciated.
regards

Peter

View 7 Replies View Related

Modules & VBA :: Access 2010 Copy Data From One Field To Another In Form

Jul 1, 2013

I am using Access 2010.Most of the time a tenant pays his exact rent. When that happens, I currently type in the payment (taken form the Rent field) and date of payment (current date) into a form. The date should not change.

I would like to place a checkbox into the form. If checked, the rent would be entered into the payment field and payment date (current date) would be entered automatically. Otherwise, I would just enter in the payment and date manually.

FIELDS
Rent

Payment
PaymentDate

on form chkPayment

View 4 Replies View Related

Forms :: Loop Through A Datasheet And Copy Contents Of One Field Into Another Form

Apr 19, 2013

I am trying loop through a datasheet so that I can copy the contents of one field into another form.

I have tried using the bellow code to do this on a button click event. However when i run it I get an error telling me that the object doesn't support this property or method. Im not quite sure what this means.

Dim rst As DAO.Recordset
Set rst = Forms![Roll Out - Site Form]![Roll Out - Sign items pick list].RecordsetClone
Do Until rst.EOF
[Roll Out - Sign items added].Form![Code] = [Roll Out - Sign items pick list].[Form]![Item Category]

Loop

View 6 Replies View Related

Forms :: Using OnClick Event To Open Query Text Displayed In Form Field?

Oct 10, 2013

I have a table that holds the SQL texts for ca. 1000 Select queries (mostly minor variants that are used to programmatically swap out RowSource strings for combo boxes). I'd like to have a quick and easy way to open/review/modify these queries.

One strategy would be to display the SQL strings in a field on a Datasheet form, then use an onClick event on a text box linked to the SQL-holding field (or perhaps an onClick event tied to an unbound text box on the form) to open the associated query. That would allow me to view the SQL of the query that I want to open, allow me to quickly scroll through the list of stored SQL texts, and give me options for sorting or limiting the SQL-texts displayed in the datasheet form.

But, I can't seem to get the onClick event to work. The problem seems to be that I can't figure out how to pass the SQL string contained in the field to a function that will use that string to open the query .

View 10 Replies View Related

Send A Content Of Unbound Field In A Form To A Field In The Table

Feb 26, 2006

in my form I created an unbound field with a requested combination, now how can I put those in a table field.
in other words, how can I send the content of a form's unbound field to a field in the table?

your help is very appreciated.

Regards,
CS.

View 3 Replies View Related







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