Adding One Entry To More Than One Table At Once
Oct 15, 2015
I have created a database and I have the same primary key(SITE) for more than one table. I can not seem to figure out how to create a query to add an entry to all the tables that have site as the primary key. Also, I am running Access 2003
View Replies
ADVERTISEMENT
Oct 20, 2006
Hi, I have 7 tables in my database and 1 form corresponding to all the fields in these tables (linked by a query by recordsource). My problem is that the form will only show a record if ALL 7 tables have manually had the primary key entered (not good when i have information that needs to be added at different times). How can I make it such that if I create a new record on the form that all primary key fields will be updated, and this record will be present every time i open my the form??
Cheers
Tania :o
View 2 Replies
View Related
Jul 17, 2013
I have a combo box that is not tied to any control but uses a value list as the row source in the data tab. My question is... it currently holds two names but I am wanting to add a third but when I do the third name does not appear like the first two in the form view. The first two show:
Last Name, First Name, employee #
And the third shows
Last Name, First Name
employee #
And on the third entry... the first name shows where the employee # should be
View 6 Replies
View Related
Dec 14, 2014
I have a form for entry and some fields are computed or result of a query from another table. I have a function that looks up a value from another table like so
************************************************** ********
Public Function GetTargetType() As Variant
GetTargetType = DLookup("type", "tblFormulations", "[tblFormulations!formulation]=Forms![frmNmsConsumptionEntry]![formulation]")
End Function
************************************************** ********
Which works fine when I test in the immediate window.Then I have this form event. This however does not insert this value when I am adding records using my continuous form.
************************************************** ********
Private Sub Form_BeforeInsert(Cancel As Integer)
Me!target_group = GetTargetType()
'Forms!frmNmsConsumptionEntry!target_group = GetTargetType()
'[tblNmsConsumption.target_group] = GetTargetType()
End Sub
************************************************** ********
making sure I can insert this value once retrieved.
View 7 Replies
View Related
Jul 24, 2013
I've got a table tblPatienten, a table tblRechnung and a form frmRechnung.
The primary key in tblPatienten is KundenNummer, the primary key in tblRechnung is RechnungsNummer. The relationship between tblPatienten and tblRechnung is one to many.
Now, every patient (stored in tblPatienten) is allowed to make multiple orders (stored in tblRechnung).
How can I assign each new order entry in frmRechnung to an existing patient in tblPatienten?
View 10 Replies
View Related
Jul 1, 2013
I have 2 tables, master & child. with a one to many relationship.
On one of my forms I want to display some of the fields from the master table and only the last entry from my child table.
How would i accomplish this?
View 5 Replies
View Related
Nov 18, 2013
I have one main table with a list of equipment. I have a second table where there will be a form for damage reports.
What is the easiest way to make multiple entries from the second table correspond with a single entry on the main table?
Some equipment pieces might have dozens of damage reports, while some might not have any.
View 1 Replies
View Related
Nov 23, 2004
I have an input box that gets a string from the user. I want to put that string in a table. How would I do that?
View 4 Replies
View Related
Mar 11, 2008
Hi there. My mother (who hasn't programmed in say 25 years) has been driving herself absolutely up the wall trying to figure something out. So I'm asking here since my programming knowledge does NOT include Access. We have a form for keeping track of previous appointments and scheduling the next appointment. It's a simple form consisting of a "Date Last Visit" text box, an Interval integer text box, and a Date Next Due text box.
What we're looking for, is to have it so that when the user clicks on or tabs to the Date next Due text box, it reads what's in the Date Last Visit variable and changes Date Next Due to Date last Visit + 3 months. So... here's what we have.
Code:Private Sub Date_Next__Due_GotFocus() 'MsgBox (Interval) If IsNull(Date_Last_Visit) = False Then Date_Next_Due = DateSerial(Year([Date_Last_Visit]), Month([Date_Last_Visit]) + Interval, Day([Date_Last_Visit])) End If 'MsgBox (Date_Next_Due) End Sub
Now if I uncomment that bottom msgbox, it shows the correct Date_Next_Due... But it's not displaying it on the Form, nor is it updating it in the table! We've had this working before, but due to an accidental deletion and some other messing around, I CAN"T FIGURE IT OUT! So why isn't it updating?
If there's anything else you need to know, please ask. We really need this to work. Thanks so much in advance!
View 2 Replies
View Related
Feb 6, 2007
I have created a part number generator for our Manufacturing company. Usualy there are a few changes on some of the information within a few days of being created. Is there a way to lock information in certain rows, after it is finalized?
Thanks,
James
View 1 Replies
View Related
Oct 13, 2014
Can I determine what the 1st and last entries are with a key from a different table
For example I have a job parts table (ID= JOBPARTID). There is a specific part that may be replaced several times. I keep these parts on a separate table called swaps. The swaps table is purely
SWAPID (KEY)
JOBPARTID
PART
PARTDESCRIPTION
SO on file I'll have
SWAPID JOBPARTID PART PARTDESCRIPTION
001 1234 PART1 DESC1
002 4231 PART2 DESC2
003 1234 PART3 DESC3
004 1229 PART4 DESC4
005 3241 PART5 DESC5
006 1230 PART6 DESC6
007 1234 PART7 DESC7
008 3289 PART8 DESC8
For JOBPARTID I want to be able to get the first record (SWAPID =001 for PART1) and the last one (SWAPID = 007 for PART 7).
How do i go about it?
View 4 Replies
View Related
Aug 6, 2014
I have a database that makes use of standing orders. That means that if a client has a standing order to receive products during for example 4 time as year (quartely at the end of the month). to automate the new entry by copying an old entry in the database.
Let's say I have a client where we will have to send a product at the end of June, it will look at a field where the next send date is, and when it reaches 2 weeks for that date, to create a new entry in the database based on that entry. This way, it will pop-up in our open cases and we are aware of it and also will be visible in our report.
View 1 Replies
View Related
May 10, 2007
In my DB I'm tracking seed. I have a form that I enter in some info in and an ID number is created (based on that info). Then in a different form I track "events" that happen to that ID (drying, moved, bagged). Is it possible to have a button or something like that that after my ID is created from my frmHarvest to automatically generate an event in tblEvents that has the date the ID number and then have something like Harvested in the description field?
If possible can I get some hints on what to do?
Thanks,
Rick
View 7 Replies
View Related
Nov 23, 2007
I have a simple table called CUSTOMER with contact details on there...First NameSurnameDate of BirthAddress 1Address 2Address 3Town/CityCountyPost CodeemailetcI have a second table called TOWN_COUNTY_REGION that lists all the towns and cities in the UK. Each Town/City is listed with its corresponding County and Region. This table has 3 fields...Town/CityCountyRegionThe TOWN field in the CUSTOMER table is populated by the user selecting from a list of towns in the TOWN_COUNTY_REGION table. When a user clicks the town that they are in, I would like the appropriate COUNTY and REGION fields to be automatically populated in the CUSTOMER table. So, for example, if the user clicks LIVERPOOL from the list of towns and cities, Merseyside and Northwest should automatically be populated in the other 2 fields.How do I do this ??Many thanksAllan
View 13 Replies
View Related
Dec 18, 2007
Hello all,
I just wanted to run this by some experts before I go mucking around in my db. Basically, I am creating a data entry form to populate with information about car parts, and the vehicles they apply to. This is what I am working with:
tblParts tblModelsParts tblModels
PartID ModelPartID ModelID
PartNumber PartID ModelNameID
PartDesc ModelID ModelYearID
I am trying to build a form that will allow me to enter new part numbers and descriptions into the table, and then have the user select (through a listbox?) all the vehicles the parts apply to. Is there a way to populate the junction table with each combination of partID and ModelID automatically? NOTE: tblModels is already populated with data.
I am assuming there would be a way to do this... A query of the junction table (and tblModels?) as the recordsource for the form, and then a subform with the tblParts as its recordsource?
I would have posted this in the massive thread I have going already... but I thought it might be nice to give Craig and Adam a break from helping me :o
View 14 Replies
View Related
Oct 22, 2007
I am learning access on my own, so please bear with me.
I am using Access 2000.
I have a form with a combo box. I use this form to enter data into the database. The combo box selections are from a separate table. If the required entry is not in the drop down menu selections from the table, the user needs to type in the proper selection. If this happens I want the table driving the combo box dropdown to be automatically updated with the new entry so that the data will appear in the drop down menu selections the next time. How is the best way of accomplishing this. Thanks for any answers and examples.
View 4 Replies
View Related
Aug 27, 2015
I have a Form that is used for creating entries to fill a table. On the same Form there is also a list that shows everything in the table and a double click on the list will populate the Form with that data. The problem is that "Save Record" command button will not update the table because it thinks it is creating a new record.
The code to populate the form from the list is
Private Sub EmployeeEntryList_DblClick(Cancel As Integer)
Me![Number] = EmployeeEntryList.Column(0)
Me![EmployeeNumber] = EmployeeEntryList.Column(1)
Me![FirstName] = EmployeeEntryList.Column(2)
Me![MiddleInitial] = EmployeeEntryList.Column(3)
Me![LastName] = EmployeeEntryList.Column(4)
Me![Supervisor] = EmployeeEntryList.Column(5)
Me![Group] = EmployeeEntryList.Column(6)
Me![Shift] = EmployeeEntryList.Column(7)
End Sub
how I can make it populate the form if an entry is double clicked and then be able to save a modified version of that record over top the original.
View 6 Replies
View Related
Aug 22, 2014
i have 2 tables, "Items" and "Locations" and i created one to many relation from each table to 1 conjunction table, and Added one extra field called quantity into the conjunction table, so now the conjunction table has 4 Fields, ID AutoNumber and "Item" "location" "quantity" Fields, ok and i turn it into query then put the fields in form and use it as a data entry
im looking for a way, where if I choose an item From the item combobox, the locations where this item has quantity in it, would be available in the locations combobox, so i can add on the existing quantities...or to make it eazier, when i choose an item, it would let me choose all the location names which have this item next to it, so i may ( edit and add) the previously set quantity field
View 5 Replies
View Related
Sep 8, 2013
I am working on creating an access database for tracking physical assets linked to locations. I need to make a combo box list to show items other than the current location of the asset. Basically I need it to refer to last enery of the user and define the new possible entries. so we have a unique relationship between location and asset. The assets and location will always remain fixed and there is never going to be any addition. I am creating a web form so that it can be uploaded into sharepoint.
View 3 Replies
View Related
Aug 19, 2015
I'm developing a database for the hospital I work in. One purpose of this is to keep track of patients with temporary invasive devices (there are many types such as urinary catheters, ventilators, etc.), specifically how many days each patient has a device for. Each device is associated with one patient only, but one patient may have many devices. Here's how the associated tables are set up:
1. tblPatients - PatientID (PK), LastName, FirstName, DOB,...
2. tblLocations - LocationID (PK), LocationLabel,....
3. tblDevices - DeviceID (PK), DeviceType, Device, DeviceDesc
4. tblDeviceUse - DeviceUseID (PK), DeviceID (FK), PatientID (FK), LocationID (FK) (where in the hospital was device inserted, e.g., operating room, bedside, etc.), DeviceStartDate, DeviceEndDate
5. tblDeviceDailyLog - DeviceLogID (PK), DeviceUseID (FK), DeviceDate, PatientLocID (FK) (area in the hospital that patient is in)
All primary keys except for PatientID & LocationID are Autonumbers; and the tables are linked appropriately.
Whenever an entry is made into tblDeviceUse, I want there to be new records to be automatically generated in tblDeviceDailyLog for each date between the Start and End Dates. For example, patient A123 had a urinary catheter from 1/1/2000 to 1/10/2000 that was inserted while the patient was in the ICU, but the patient was moved to the Medical Ward on 1/7/2000. So tblDeviceDailyLog should have 10 new records associated with this device, one for each calendar day, with the appropriate location for each day.
View 3 Replies
View Related
Sep 19, 2013
I'd like to learn how to do them quickly and effectively in Access. One of those things seems like it would be an incredibly simple, intuitive operation, but it's not, at least not to me.Say I have some data that really should only be on one table, but it's currently on two tables in Access: "List Main" and "List September Adds." They both have the following fields: "Full Name" "Email" "Address" "City" "State" "ZIP" "Phone."
The first table is my main list of contacts. The second contains new info, consisting of 1. a few new contacts, and 2. updated info for a few of the contacts already in table "List Main."
I would simply like to put all the new contacts from "List September Adds" into my "List Main" table, and I'd also like to fill in a few missing e-mails in "List Main" with newly gathered e-mails for those contacts, info that is in my table "List September Adds."I'm sure there is built-in functionality to do something as basic as essentially turning two pages of the same spreadsheet into one. In fact, I know I could import data from an Excel file and have it "append" to a preexisting table if the fields are all the same.
However, I'd like to know how to do it when the tables are already in Access (without having to learn any SQL, mostly because I'm fairly certain I don't need to know SQL to do something like this). I've heard of Append and Update Queries and given their names, it sounds like they'd be useful, maybe with use of "Totals" and "Group By" to get rid of duplicates; however, I can't seem to get any of this to work right.
Mostly, when I think I am doing an Append correctly, it doesn't add new data at the bottom of a table; it just wipes out all the data that was there, and replaces it with data from the source. For instance, when I've been running an Append Query to get my "List September Adds" rows into my "Main List" table, what I end up with is only the "List September Adds" rows, and all the "Main List" rows gone.
View 7 Replies
View Related
Jun 14, 2005
I am working on a jobs database where employees enter information where the job is being handed off to. I want to create a table showing the latest job entry by date. The jobs are listed by "Job Number" and when I try to create a table and remove the duplicate "Job Number" it does not always remove the oldest entries.
Any help would be appreciated.
View 1 Replies
View Related
Oct 8, 2007
I have a table that lists county names. On the data entry form only the county names are displayed. However, I have another form that is used to build a custom query based on various criteria, of which county is one.
To make the table compatible with both both forms, the data source for the dropdown list for data entry is: Select * FROM county WHERE county <> "No Selection"
For the SQL form the code is simply: Select * FROM county The default value of the dropdown list is "No Selection". When dropdown list for county is set to "No Selection" the program interprets it as "select all counties". Other dropdown lists provide other parameters such as the project year, nature of the project etc. Each of these other dropdown lists also have a default value of "No Selection". The SQL form thus gives me the ability to mix and match several criteria. For example, it will display all projects in a particular year for a particular county or all projects in all counties that involve the construction of a residence.
My question, instead of physically having the string "No Selection" in the table itself, is there a way to embed the phrase "No Selection" in the SQL expression itself and still have it as an option on the dropdown list?
View 1 Replies
View Related
Jan 31, 2006
http://i9.photobucket.com/albums/a66/bubbajoe12345/workspace.jpgI've created a nice form for entering information into the record -- works for viewing the records as well. Here's the thing, in a traditional Rolodex you can somewhat see the names of nearby records. With this form as is, when using the arrows at the bottom to move around in the records, you can't really be sure how far away the name you're looking for is. See that mini table in the top left corner? I'd like to make it so that, when you click on a name there, the rest of the form changes to the corresponding information.
All of the rest of the form is linked through social security number. When a new person is chosen in the main body, all of the other tables change to reflect his information. Except for that single table in the top left corner. That table is unliked to the other tables and is merely sitting there on the form right now.
So, how can I link them such that selecting a name from that top left corner will change the person in the main body of the table (and thus change the other tables)?
While I'm asking, what's involved with turning this form into one of those Database Web Page things?
Thanks for all of your help, everyone, I wouldn't have made it this far without you.
View 5 Replies
View Related
Aug 23, 2006
Okay, for simplicity's sake, I have a data entry form.
It is bound to tableData.
Inputs are:
ProductID
Customer Name
ProductID is a combo box.
There is another table called tableProduct. In this table, is ProductID and ProductName.
For convenience sake, when a user chooses a ProductID from the combo box, I want it to lookup that ID from tableProduct. However, how can I do this when everything is already bound to tableData?
Thanks in advance.
View 1 Replies
View Related
Aug 23, 2006
Okay, for simplicity's sake, I have a data entry form.
It is bound to tableData.
Inputs are:
ProductID
Customer Name
ProductID is a combo box on the form.
There is another table called tableProduct. In this table, is ProductID and ProductName.
For convenience sake, when a user chooses a ProductID from the combo box, I want a separate textbox to lookup that ID from tableProduct and display the ProductName.
How can I accomplish this?
Thanks in advance.
View 2 Replies
View Related