Updating A Form Based On A Query

Jan 31, 2005

First, let me point out that I am a new Access user, so apologies ahead of time

I have a form which has a field called 'Initials'. I want this field on the form to default to whatever was last entered (into the table called 'Main Table'). I first tried setting the default value with a DLast command, which seemed to work for a day or so, but then it returned values from mid-table - very strange

I then set up a query which does return the value of the last Initials entered (cunningly called 'Last intials entered'), but I can't get the field in the form to default to this value - it comes up with #Name?

Can anyone help, or have I not explained myself very well

Cheers

View Replies


ADVERTISEMENT

Updating Several Tables At Once From A Form Based On A Query

Jan 8, 2006

Hi,
I've spend ages reviewing the relationships between my tables and changing my query but cannot get this to work. I've read alot of the posts on the subject also but trying to apply the suggestions to my problem hasn't worked.

It is a database of engineering drawings. A drawing can have one or more revisions. I have written code to import the drawing and revision info into the datebase so when the drawings are actually received I need to be able to add the additional data in tblReceivedDrawings such as the tracking number, date received etc.
These are my tables:

tblDrawingRegister
DrawingNum (PK)
DrawingName

tblDrawingRevisions
DrawingNum (PK)
Rev(PK)
LatestIssueDate
ElectronicCopy
OrderNum
DrawingStatus

tblReceivedDrawings
DrawingID (PK) auto-num
DrawingNum
DrawingRev
DateReceived
ActionCode
TrackingNum

I have created a query called qSelDrawingsAndRevisions which combines tblDrawingRegister and tblDrawingRevisions.

The form is based on a query called qSelIncomingDrawings. This query joins qSelDrawingsAndRevisions and tblReceivedDrawings. It shows all the records from qSelDrawingsAndRevisions and related records from tblReceivedDrawings and is joined on the drawingNum and Rev.

Adding the extra info e.g. tracking num, date received etc about drawings that are in tblDrawingsRegister works fine. However if I want to add a completly new drawing I get an error message:
"The Microsoft Jet database engine cannot find a record in the table 'tblDrawingsRegister' with key matching field(s) 'qSelDrawingsAndRevisions.DrawingNum'

How can I get it to update the drawingNum in tblDrawingRevisions and tblDrawingsRegister at the same time?
Is it an issue with my query or relationships?
Or do I need to write an OnUpdate procedure for the DrawingNum textbox so that it created a new record in the DrawingsRegister table to correspond with the one in the DrawingsRevisions table?
I have a feeling that this might be overcomplicating it and that I just need to change the query?

Am very confused about how to approach this and would really appreciate a few pointers...

View 12 Replies View Related

Updating Information In A Form Based On Query

Apr 29, 2005

Hello

I have made a form based on a query that pulls information from 4-5 tables. I would like to be able to change information in those 4-5 tables by using that form, but I am unable to do it. I opened up the properties for the form and set "data entry" and "Allow edits" and "allow additions" and "allow subtractions" all to YES. That didn't help.

Is it possible to do this, since the form is based on a query? I couldn't figure out a good way to set up the form getting the information directly from the four tables. I'm not sure why it's been so difficult.

I have one table full of all of the various titles I have. The tables are related using those titles, and each table has a different sort of information for each record. So, the "main" table is "ALL TITLES," but when I go make a form, I can't get ALL TITLES to be the controlling table. It's very frustrating. But a query works beautifully--I just can't change anything.

(I would like to have the form be a "user-friendly" way for people to make changes.)

Thanks for your help.

-Siena

View 2 Replies View Related

Updating A Form Based On A Query Using The "total" Feature

Aug 24, 2004

I have set up an ACCESS database of journal articles. Each article has one or more authors. I have created a form listing the article title, the name of the journal etc. Included is a subform listing each of the authors. The authors are listed in the order that their names appear in the article. I wrote a query to sort the articles alphabetically according the name of the first author (in the subform). The main form is based on this query so that all the articles are sorted according to the name of the first author. However, the query uses the “First” feature in the “Total” row on the query. The use of this feature precludes me from updating information in the form that is based on the query. Is there a way around this problem and if so what is it?

View 1 Replies View Related

Updating - Based On A Query

Jun 29, 2005

I have a list of sites (approx 15,000) that I need to update.
Basically, against each site we store a region code (HR1 - HR7) and we have decided to increase the number of regions we operate with. I have created a spreadsheet that states the post codes included in each new region (NR) and now I want to create a query that looks at the post code of the site, then according to my spreadsheet, changes it to the new region. There are no new sites to be added, simply old ones to be updated.

How can I do this easily?
I have imported my spreadhseet into access, and I have all the data there - just unsure of the query to update.....

View 11 Replies View Related

Reports :: Updating Report Based On Crosstab Query

Apr 19, 2015

I've got a self updating crosstab query, its essentially a monthly summary and every month a new column is added (one corresponding to the current month, i.e., next month the new column will be may, following that the new one will be june, etc)

I've designed a report to be based on this query and i tested it out by manually adding data for next month into a table, the query auto updated however the report remained the same (ended in april instead of adding a new column for may).

Just curious if there is a way to automatically add these new columns to the report every month or will i have to do so manually?

View 1 Replies View Related

Forms :: Parameter Based Query - Filter A Form Based On Another Form

Mar 20, 2013

I have a form which uses a parameter based query to present an individual senior doctor with a list of names for of individual juniors to provide an assessment report on. When the first form opens the user enters their RespondentID.

Once senior has decided which names to comment on I have another form which has the questions to be answered which is opened by clicking a button on the first form.

How can I pass a parameter from the first form to the second so that only the records relevant to that senior doctor are displayed? The underlying table has 60 senior doctors and 20 junior doctors. The senior doctor is identified by the field RespondentID in the first form. I've tried putting a WhereClause in the FormOpen command but I still get a dialogue box asking for the parameter RespondentID when the second form is opened.

View 2 Replies View Related

Modules & VBA :: Updating A Field In A Form Based On Another Table Field

Sep 13, 2013

Using Access 2010. Fairly new to automation and macros.I have two tables (tblProductReceived and tblBins) and a form (frmProductReceived).A field in tblBins corresponds to a location the bin is at (named BinLocationID) and the tblProductReceived table tracks product that a specific bin has received.

What I need is for the tblProductReceived field PRLocationID ([tblProductReceived].[PRLocationID]) to be automatically populated with where the bin is at ([tblBins].[BinLocationID]) when selecting a specific bin in the form (frmProductReceived).

View 1 Replies View Related

Queries :: Query To Run Before Report Based On Criteria Based From Two Combo Boxes On Form

Mar 20, 2013

I have a report that gets its data from a query. I need the query to run before the report based on criteria based from two combo boxes on a form.

View 3 Replies View Related

Chart Based On Form Based Parameter Query

Mar 22, 2006

Hi all,

stuck on this, not sure if it can be resolved....

I have a parameter query for which the parameter is based on a form field entry (i wanted to avoid the dialog box popping up).

No problems with this....however, I want to create a chart based on the same query however, i get the following error message because it does not recognise the query parameter.

Error Message: The Microsoft Jet database engine does not recognise '[Forms]![frmChooseDTDate]!DateOccured' as a valid field name or expression.

Can this be resolved?

Help most appreciated!

regards to all

K

View 2 Replies View Related

Forms :: Update Form / Query Without Updating Underlying Tables To Query

Jul 23, 2015

I have a form which will be used as the basis to print a label.

It is bound to a query and when I open the form I pass over a 'where' condition to return 1 record. I then use the query to produce a report/label.

What I want to do is to update the form/query without updating the underlying tables to the query.

View 14 Replies View Related

Updating A Query, When Still In The Form

Jul 26, 2007

I have 2 fields in a form called 'Employee No's' which use a combo box (this information for these comes from a query). However, I have another form called 'Employee Details' (this form comes from the same table as the query is taken from).

The 'Employee No's' form opens by a command button in the 'Employee Details' Form. However, what I need to be able to do is for the query (used for the combo box) to update with information I have just put in the 'Employee Details' form while I have not yet closed the 'Employee Details' Form.

Would I use an SQL statement for this? If so what would I put?

View 1 Replies View Related

Updating A Timestamp From A Form Or Query.

Feb 26, 2008

I have a form that opens a subform with a list of work orders by who they are assigned to. I would like to be able to close any or all of the work orders. When I close them, I need the timestamp to be updated, but I can't seem to figure out just how to make that happen. Any ideas?

View 3 Replies View Related

Forms :: Sub-query Not Updating On Form

May 1, 2014

1) I Created a button that imports data into a table (Hours)
2) I created a query that finds duplicates in that table
3)I created a form put the button on said form
4) I dragged my query from explorer window onto form
5) I click button, code runs to import data into table however query on form doesnt update, I have to close and then re-open the form, obviously this is no good.

View 1 Replies View Related

Updating Table Field Using Query Or Form?

Dec 23, 2014

I have a table holding clients data, I need it to work out the age of someone when an application is made, which I would like to be stored on said table. I have two fields [DOB] and [signed date], which I have used created a query with and an (unbooud?) field called age at application with the expression =DateDiff("yyyy",[DOB],[Date signed])

This works fine when I run the query, but I am unsure of the new next step of how to commit it to the table and even if that's possible.Ideally I would like this to run behind a form maybe using some click event after the [signed date] field has been entered.

View 5 Replies View Related

Updating A Field Based On A Certain Criteria

Nov 6, 2006

Is there a way in a query (using SQL) to go to the first record to update a field based on a criteria ?
For example if my amount field shows two amounts for $300.00 I want to go to the first record that has $300.00 to update a field in that record.

Is that possible?

View 9 Replies View Related

Updating A Field Based On Previous Record

Apr 3, 2008

I'm trying to update an imported table from an excel spreadsheet with missing details. The table's records are in order so I just need to fill in a blank field with data based on the previous one as shown.


ID Name Location
1 Bob London
2 Larry
3 Harry
4 Jerry Glasgow
5 Paul
6 John Southampton


I need to fill in the location blanks simply with the last location details, so records 2 and 3 with London and 5 with Glasgow. Is this easily done or would I need to pull all the data into an array and work on it there?

I've tried searching for an answer but haven't had any luck.

View 1 Replies View Related

Updating Data On 2 Tables Based On Criteria

Oct 8, 2004

Ok. Here's the situation. I have query setup. This query has 2 columns:
1. Agent Name
2. Sale Value

I have 2 tables.
Table1: Includes Sales for this pay period only
Table2: Includes all Sales From past to present.

We are setting up our system on Tiers and Each sale value is going to change. So, Here's what I need:
I need to run an update query that first Looks up all the records in Table1 based on Agent Name. The field that needs to be updated is called SaleValue. It needs to be updated with what's in my Query mentioned above.
Then, all the values in Table1, need to be copied (or updated) into Table2. This can be done based on the Primary Key (SaleID), which exists in both tables. So I guess we will need to run 2 separate update queries. Any ideas on how this can be done?

View 8 Replies View Related

General :: Show Query Result In Form Textbox Immediately After Updating A Record

Nov 24, 2014

I am building a Inventory Management Application for Tyre Shop. I have SaleMainTbl and SaleDetailTbl both used for preparing daily sale summary. I have Mainform based on SaleMainTbl with TxnDate and Total Amount (Sale) and the TxnDate is in one to many relation with SaleDetailTbl. FormSaleDetail is multiple row(continuous) form that makes billwise summary of each day having -TxnDate--BillNo--ItemSold--Company--Qunatity--Rate--Amount fields. I have inserted this form in FormSaleMainTbl.

So FormSaleMainTbl is Main form and FormSaleDetail is subform. TxnDate in FormSaleDetailTbl is automatically taken from SaleMainForm. I have further added text boxes in Main Form to show company wise sale for each day for which there is a query build one for each company that takes the currently loaded date from FormSaleDetail and calculates the Sale (Sum) of each brand (Company) of Tyres. All these objects are working very fine. However I have to close the MainForm and reopen it for result of query to appear in the appropriate text box in Main form.

Is there way to do this as soon as record is entered or at least at the end of completing the entry of each days sale transactions without closing the form. So the gist of the problem is realtime display of query result in text box on a form or updating the form screen immediately on updating any record or at the most after completing the updating of form but without having to close the form.

View 5 Replies View Related

Forms :: Updating Subform Using VBA Based On Specific Selections

Mar 8, 2013

I have a Form named 'Opening_Screen' which consists of various objects - Combo Boxes, RadioButtons, Check Boxes which the user can select.There is a subform called 'Report' within the 'Opening_Screen'. The source object of the subform is a query (called 'QueryX').

There is a button called 'Generate Report' on the form which when clicked - an SQL must run on the backend, update the query which in turn should update the Subform 'Report'.For me, the QueryX gets updated, but the subform doesn't. When I manually switch the form to Design View and then back to Form View - the subform gets updated. I tried the same through the vba code instead, but it doesn't update the subform.

View 10 Replies View Related

Queries :: Inserting And Updating Based ID In Main Table

Sep 29, 2013

I have add my two tables

Main table calls Attack
Sub table calls Research

the main table attack is linked with sub table Research by Attack.ID and Research.attack_id from form automatically

The sub table Research have more than one record which is linked into the main table Example:

How can I get the data which is marked in blue into record 24 and the data marked in Red into row 23

using Unite_Equal column?

View 3 Replies View Related

Modules & VBA :: Updating Records Based On File Location

Mar 3, 2015

I have created a database that tracks the locations of all the faxes we receive in a day. We have a dedicated employee that enters them into the database as well as who they are assigned to and other pertinent information. At the end of the day, I monitor the network folders where the faxes are saved to change the status of the fax in the database to done, still needs processing, or awaiting approval. Is there any way that I could set up some VBA that would automatically update the status column for the record based on the location of the file? The file name is recorded in the database so then if it sees that that file is in the end folder it could automatically update the status to finished.

The response I got on another forum is as follows:

-The impression I'm getting is that you've got a database of information over here.
-And it lists the file name, but not location.
-And then you have a physical folder structure with the fax files in it.
-And there are folders for done, awaiting approval, or processing.
-So what you're looking for is something to read those folders and update the status column based on which folder it is in?
-So at the start of the day we have:

New
-Fax1.tiff
-Fax2.tiff
-Fax3.tiff
-Fax4.tiff
Finished
-
In progress
-

And at the end of the day the folders look like this:
New
-Fax1.tiff
Finished
-Fax3.tiff
-Fax4.tiff
In progress
-Fax2.tiff

And you want your code to browse those folders, and update the status of each filename based on it's folder?If the filenames are unique, you can just use VBA to open the folder, create an array of the files and then set the status. Create two separate functions, one for in progress, one for completed and call them one after the other. There'd be no need to check the current status, but you could store the wrong status if a file is duplicated, or a filename repeated.

View 3 Replies View Related

Queries :: Updating Column With Various Results Based On Other Record Values

Jul 11, 2013

I have a field called density which needs to be updated to show either 10, 20, 30, 40, 50,60, 70 or 80 depending on a number of variables, for example: If market location is 'hot' and unit type is 'house' and discounted is 'no' then show '10' in the density box.

or perhaps:

If market location is 'cold' and unit type is 'apartment' and discounted is 'no' then show '20' in the density box.

I have tried all sorts of expressions and queries but have really reached the limit of my know how and can't solve it. Is it even possible to do this in Access?

View 2 Replies View Related

Forms :: Checkbox Based On Status - Updating A Text Field

Mar 8, 2013

My database has a text field "Status" where the text is either, A, W, C. There is a form to update this field; currently it uses a standard Access created text field. The users want a checkbox which will show up as checked when the status is W, if the status is anything else, the checkbox will be blank. If the user clicks the checkbox within the form the status will be changed to W.

If [table.status] = 'W'
then checkbox = 0
else
checkbox = -1

and then somewhere on the update it would be

if checkbox = -1 then [table.status] = R

Except that Access doesn't think the way I do.

View 1 Replies View Related

How To Clear Values In Specific Fields Based On Updating Value Of Another Field

Feb 27, 2015

I am working on form where the user selects either "IN" or "OUT" from a dropdown of field name "CheckOut" in Frm1.

If they select "OUT" they will in turn need to fill in 2 additional fields. When they change the value back from "OUT" to "IN",

I want those other fields to be cleared of data for just this record so next time they change back to "OUT" from "IN" those 2 additional fields are already blank.

View 1 Replies View Related

Using A Query Based Form

Mar 14, 2007

I'm working in Access 2003
I have a table of projects done by my company, which includes
-organization name
-project year
-service 1 provided
-service 2 provided
-service 3 provided
-service 4 provided
-project fee
-project consultant 1
-project consultant 2
-project consultant 3

I've created a Query Based Form where you can enter in any combination of search criteria (e.g. org name and btwn 2001-2004) and the button press runs a query that returns a table of projects that match all the criteria you've entered.

I've figured out (I have no formal Access or programming training) what to set the criteria as in the query so you can get info by entering org. name, project year (with start and end dates) and/or project fee (with bottom and top amts).

The issue that I'm having is that I want to be able to enter a consultant name into the Form, and have the query return any projects that have that consultant listed a either project consultant 1,2 or 3 - and the same idea for the service provided. Right now I can only get the query to look in the 'service 1 provided' and 'project consultant 1' columns.

I had a thought that I could run 3 different queries - 1 that will look at org, date and fee, a 2nd that will look at all consultants, and a 3rd that will look at all services - and then run a 4th that would give me a table that only showed projects that appeared in all 3 of the other queries. However I haven't been able to figure this out, nor do I know if it's the best way to achieve my desired result. Right now I have the 4th (using UNION) showing all projects that show up on ANY of the 3 queries, plus the button press makes all 4 query result tables pop up, and I'd like it if only the 4th (final) query produced a visible result.

Any ideas or help would be greatly appreciated. Thanks!

View 3 Replies View Related







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