Forms :: Using A Form To Enter Data Across Related Tables
Mar 3, 2014
I have a database I made to store a list of users and information about each user.
I have a UserDetail table, languages table, previous experience table, current experience table.
UserDetail table as follows:
UserID (PK)
First Name
Last Name
Full Name (calculated)
Department (using a multi select combo box. There are 3 departments and some people are in both).
I need to do the same thing on each table and each table is very similar so I'll just list one. This is the Previous Experience table:
I have three junction tables. One for each Previous Experience, current experience and language table. The Previous experience junction table has:
ID (PK)
UserID
PreviousXPID
I created a relationship between the userdetail table and the junction table then the junction table to the Previous Experience table.
Now what I'd like to be able to do is edit people to add previous experience, current experience and languages to each. I already have a form that lets me add a new user to the database. It's just based on the UserDetails table. If I could have a way (perhaps using 3 multi select list boxes. One box for previous experience, one for current experience and one for languages) on that form to add the other details to that person, that would be ideal. I'd like to create a new user. E.g. Joe Bloggs in department 1 who speaks Dutch, used to have Marketing, Chemistry and aeronautical experience and now works in IT.
I can create the new user by putting last first/last name and selecting the department. But to add experience or languages, I have to go into that junction table and add the numbers myself. e.g. user 1, has experience 1,3,4 and 5. I'd like to see the name that relates to the ID and be able to select it from the list in the table I have.
I have a form within my database in which the user will enter data which will go into 2 separate tables. These 2 tables (Job and Client) are related. At the moment I have a subform in which the user enters Job information, and the main form where the user will enter client information.
The problem being is that the 2 sets of data do not associate themselves with each other, despite being related (The Client will be related to a job number. A client can have many jobs but a job can only have one client etc). It has to be done manually in the table which is not ideal as the DB will be split and rolled out to users via Access Runtime. I have been working on this DB for a while now and the problem is most likely right in front of me but I cannot see it!
I had an existing database with 2329 records entered into it. All of the fields (220ish) were all in one table. Myself and my co-workers wanted to rebuild the database without losing the data. We wrote queries to transfer the data from the original database to the new database and split the data from the original 1 giant table to 9 smaller tables.
The transfer of data worked so I went to start making forms. When I went to add fields from different tables I had to built a relationship, which I did. All of the data that transferred over from the new database is in the form (now multiple forms linked by button) but I can't add new information. I get an error stating, "You cannot add or change a record because a related record is required in table ..." and the table referenced keeps changing.
I need help. I am not sure if this is a form issue or a logic issue i have a db for tracking students the classes they take and their notetakers for classes. Each class is most likely unique to each student but sometime there are multiple students in each class that need a notetaker and there should only be one notetaker per class. I have 3 tables and they are all linked through a unique iD called CRN (number).
I am looking for a way to add a student to a class and create a class at the same time in one form. I am trying to limit the redunancy by adding a class each time and then adding a student to the class.
Any suggestions would be great. I have gone through 10+ redesign and am just at a loss on how to accomplish this.
I created a form that allows users to enter data into the fields and populates the table.But can I have it do that and populate instead of one table, two tables?
I have a form based on a table which includes the mid field. I want to have a macro that takes the value of the current mid, and makes a new record in a 1-many related table (consisting of record id (auto), mid and trmntdate), paste the mid and insert the current date.For the life of me I cannot get it to work? The process should be something like:copy mid value, add new record to related table, paste value in mid, insert current date in trmntdate, save. I've tried append queries, experimented with copy etc, dabbled blindly with VBA and not got anywhere.
I was able to enter data into my form but I made a few design tweaks and added another table into the form and now, in form view, I''m unable to enter data into any field.
I have been having problems with opening a form to add new records only. I have gone through all possible solutions but somehow the problem persists.I want to add new records only and not view any of the existing records. I have set the form properties to Date Entry Yes, Allow additions to Yes, Allow Edits to No. The form opens through a command button on another form and the vba code is the following.
I have a table TO-det and another table DO-DET.The table DO-det will have details about all DO for each TOID record.Both have a common field name TOID The tables are related under ONE-MANY relationship.One TO-DET record can have many DO-DET record
Now I wanted to create a form where if i add a new record to TOID i must also be able to add data for DO-DET for that corresponding TOID.
I have a form displaying the 11 fields of the parent/primary table using a selection from a combo box. I am using queries and vba code modules respective to form, combo box and command buttons. I have initial code that uses the two fields from the combo box selection to append same to a new parent/primary archive table. I now want to add to the append SQL the remaining fields to the parent/primary archive table. When I add the second sql string for the remaining fields to the same procedure and execute I keep getting 'null in primary key'. If I copy the primary record and paste same into the archive table it works.
Private Sub Command26_Click() On Error GoTo Err_Archive_Primary_Click
Dim strSQL As String Dim strSQL2 As String
strSQL = "INSERT INTO ARC_289325045 ([Survey Point ID], [Survey Area Detail], [Date On Site]) " & _ "VALUES ('" & Me.cboAreaDetailDate.Column(0) & "','" & Me.cboAreaDetailDate.Column(1) & "'," & _ "#" & Me.cboAreaDetailDate.Column(2) & "#)"
I have a form displaying the 11 fields of the parent/primary table using a selection from a combo box. I am using queries and vba code modules respective to form, combo box and command buttons. I have initial code that uses the two fields from the combo box selection to append same to a new parent/primary archive table. I now want to add to the append SQL the remaining fields to the parent/primary archive table. When I add the second sql string for the remaining fields to the same procedure and execute I keep getting 'null in primary key'. If I copy the primary record and paste same into the archive table it works.
Private Sub Command26_Click() On Error GoTo Err_Archive_Primary_Click
Dim strSQL As String Dim strSQL2 As String
strSQL = "INSERT INTO ARC_289325045 ([Survey Point ID], [Survey Area Detail], [Date On Site]) " & _ "VALUES ('" & Me.cboAreaDetailDate.Column(0) & "','" & Me.cboAreaDetailDate.Column(1) & "'," & _ "#" & Me.cboAreaDetailDate.Column(2) & "#)"
The next step is to do the same for the child table and append related records to the child archive table. Edit/Delete Message Reply With Quote Quick reply to this message JJKramer View Public Profile Send a private message to JJKramer Find all posts by JJKramer Add JJKramer to Your Buddy List Sponsored Links
I have to make a Costing System but for that I need to enter our Expense details in database according to Fiscal year and months.
I need a table for Fixed expenses and one for Variable Expenses and then I need one or more Forms to update data in those tables. Now I've created a table with Fixed Expenses. I have to update Year and Amount in that. Now it is only letting me one entry per Expense.
I want multiple entries for one Expense say 'Advertising' for different years. I'm thinking may be I need to make more than one Table, may be one for Expenses with ExpenseID and other for Years with Year and YearID and the third one for Amount with columns Amount, Method of Payment, Date and Notes. I did tried this but I think I'm not creating proper relation may be because its only updating for one year.
I have a built a database to record and collate info about clinical trials that are run within my department. I have one large table [Trial Info] which contains all trial info and have created a second and third table [Milestones] & [Comments] to collect dates of various milestones and a notes that occur throughout the course of a study.
The milestones (dates) are recorded in the 2nd table and the comments are recorded in the 3rd table.
All data is entered by staff on forms. The first form captures basic info about the study, once this has been entered, the idea is to click a button to open the second form to document the trial milestones, this form also contains a subform for listing any free text comments required during the life of the study which are stored in the 3rd table.
I have setup the relationships between tables as best I can.
The main table with basic trial info is the parent table, linking the primary key to the foreign key in the second table, the foreign key of the third table is related to the primary key in the second table so these tables should be looking up the correct clinical trial as far as I can tell.
The form containing data from the main table has a button which I have set to open the Milestones & Comments form, and I have set this to open to the record that relates to the record in view in the primary form. The primary key is related to the foreign look-up key in the milestones table.
This opens the form fine, however this is not updating the foreign look-up key, this remains '0' which I assume is the cause of the following error when I try to save changes to the record
Quote:
You cannot add or change a record because a related record is require in table 'Trial Info'
How do I trigger the foreign key to update to the primary key so that the first time a milestone page is opened for a new study it creates a matching record?
I want to insert a huge number of data (Customer and their adress) into 2 related tables in Access. Each table in access is related by some kind of ID (Autonumber-Primary key). The first table is CUSTOMER , the other one is CUSTOMER_ADRESS . Access relate each Customer to his Adress, so if I import data into one table and then import data into another table how would the database know that all the data pertains to the same person. How to insert the new list of customer and adress without using a form? Thanks for your help.
In a subform I have all fields of a one table, when I make click in a button, open other form with info related by these ID.
All is ok but I have some doubts:
If in the second form (second table) there is no registers, how could shows me the ID by default and that the ID field is not empty
If I create a new register inside second form with a button, I would like that the ID field was always filled because the user don't need to know the ID.
I am trying to create a warehouse database in acees 2007 and 2010 that can track goods that come in.i have two types of goods Specials which is not on my current stock list and Current stock of which i have a excel sheet of around 32000+ items.I have 2 warehouse to put the stock in with over 100 locations.I am trying to track the stock that comes in by saying it is Special or Current stock if Special and i enter the data it should add it to my Stock sheet if current I can choose it from the Current Stock list; allocate it to a location .
Lastly i need to be able to move the stock either from one location to another in the warehouses or to a customer on a orderI have created a few tables and tried to link it as best i can after reading 100's of posts and access for dummies
tblProduct ProductPK-Autonumber ProductCode - Text Description - Text Dept - Text
tblLocation LocationPK - AutoNumber Location - Text
lnktblPtoductLocation LinkPK -Autonumber ProductFK - Number(long integer) LocationFK - Number(Long Integer) Qty - Number PoNumber - Text DateIn - DateTime
i set this up as a many to many relation and that is as far as i got.when i try and enter a location for a product to test it say i cant update location field and things like i cant enter data on the one side of the many to many relation.
I'm trying to create a system where if I enter data into one field it will automatically appear in the corresponding field in another table. For instance if I enter the values 10,12,15 into a field called QID in table A I would like this to appear automatically in a field called QID in table B. Both tables are related and I have enforced referential integrity and 'cascade' options but this still doesn't seem to allow one table to automatically update another. My ultimate aim would be to have a form that you filled in data for the field QID once that then propagated to both Table A and Table B.
This will be a definate newbie question but here it goes.... I am new to Access and fighting my way through building a database to learn. I have broken my tables down to as normalized as I am willing to go, mabey a little further than needed. So now I have several tables that are related. I need to know how to make a form update several tables at once and prevent the user from having to mess with the autonumbers that are created. Here is a sample of my tables:
All Primary Keys (PK) are autonumbers
tblStaff StaffID PK StaffTypeID FK to tblStaff FirstName MiddleInitial LastName SSN AddressID FK to tblAddresses
tblStaffTypes StaffTypeID PK StaffType
tblAddresses AddressID PK AddressTypeID FK to tblAddressTypes AddressLine1 AddressLine2 CityID FK to tblCities StateID FK to tblStates ZipID FK to tblZips
tblAddressTypes AddressTypeID PK AddressType
tblCities CityID PK City
tblStates StateID PK City
tblZips ZipID PK Zips
I now know that I may have taken the normalization a little further than needed but I have it done and would like to use it if I can.
I want a form where a user can add a staff member with all of their information on one form (name, ssn, and address) without having to deal with the autonumbers or needing to do it in a certain order to make it work. I also don't want excessive use of combo boxes (state is OK). So far I haven't found a way to do this, please help.
I was wondering how to create a form which is using data from three tables, the data in the tables does not have any relationship setup as they are not related to each other. When I use the wizard and I select the three tables, Access starts complaining about the fact that no relationship has been setup...
In my database I have a table that keeps track of a package of items. The package is assigned a package type (counter display, end cap, half pallet, full pallet for example). The record of the association of the package and it's type is held in the main table.
Each of these package types is either a case or a pallet (counter display and end cap are cases and half and full pallets are pallets) This relationship is kept in another table (we will call it description table).
Now, based on the type of package and therefore it being a case or pallet a UPC and a GTIN number are assigned. The GTIN number is different if it is a case or is a pallet. I have a table that stores all of the UPC and GTIN numbers available in 3 columns, one for UPC, one for GTIN Case and one for GTIN Pallet (the UPC is a standard 12 digit and the GTINs are 14 digit -with the first 2 different to designate pallet or case. and all are based on the check digit formula necessary)
The user assigns the UPC and correct GTIN number by clicking a button which applies the next available UPC code to the package and determines if the description of the type (case or pallet) and inserts correct GTIN number into that field. I actually have all of this functioning correctly.
Now the problem. If a user changes the package type, and therefore changes the description, I need to add code to the update event of the combo box that gives the choices for package type that does the following:
Check to see if the original package type was a case or pallet (it's description) and if by changing the package type it is now changed to the other, update the record in the main table to the correct GTIN number based on the existing UPC Code.
OR as I write this, maybe the code could simply update the main table with the correct GTIN code based on the new description and the existing UPC code. This was I would not need to check for a change just do the update every time.
So I have a form, it has a few fields from a related table in it, related by the name. I click 'new' on the form, but when I click save Access complains about the related table does not have a matching record. How do I have it create a new record?
I have a form with a tabbed control on it. The tabbed control has 4 tabs that each have a report on them. When I select a company name on the main form, I requery these 4 reports to show data related to that company.
For some strange reason, 2 of my reports requery with no problem, and 2 of them give me a message that the report can't be found. Here is the code:
Code: Private Sub cboCompanyName_AfterUpdate() On Error GoTo cboCompanyName_AfterUpdate_Err ' DoCmd.SearchForRecord , "", acFirst, "[CompanyID] = " & str(Nz(Screen.ActiveControl, 0))
' After selecting a company, requery the subreports to display the appropriate data
As a side note, if I chose the company, say "ok" to the error, and then go run the queries that these reports are based on, I get the correct records. Also, if I chose the company and run the 2 failing reports standalone, they work fine, so I know the problem isn't the reports or the queries themselves.
I have also checked and rechecked for any spelling mistakes and have found none. I should mention that the error message is "Programs cannot find the field 'SubrptCompany_Payback' referred to in your expression".
I have a form to enter new records in a table.But when user enter empty record i want to display a validation text to to fill the required.I tried this code.
If txtItems="" then msgbox("please fill the required fields") else code to insert the records. end if
with this code its accepting the blank record also.What is the correct code?
I know the way to SELECTDISTECT on a combobox referring to a table so the value will autopopulate in the combobox. But is that doable in a subform?
I have a table with 3 columns. First Name, Last Name, Relationship.
I want to let the user adding data directly to the subform, but when typing RICHARD in the first record of First Name, then on the second record, when they type R, it will suggest RICHARD, a kinda auto fill if desire.
I'm working on a database that tracks students and grades. I have a tblStudents with Personal details, tblStudentsAndClasses which allows me to have a one-to-many to many-to-one relationship, tblClasses with all the class info, plus a tblGPA.
I'm wanting to list all the Student's names listed with their current class and have blanks for data entry for Grade, Grade status, and have a current timestamp in another field. So the teacher can enter the Grades and Grade Status for all students on one day in a single form (think EXCEL). The way I have it now, is that (x number) grades that have already been entered shows up as (x number) copies of the same student. So my relationships are probably set up incorrectly also.
I can't filter out IS NOT NULL because I wouldn't get any students with grades already entered in.
I've found a post on another bytes.com that is REALLY close to what I am looking for, but I don't know anything about VB to be able to adjust it to fit my requirements. I would have tried to do a forum search here, but I'm not sure what terminology I would search for.
My database is tracking Job/Project information. The users must assign the Job Contacts which can be both internal and external (ie: Contracts is a Client Contact, while Engineer is an Internal position)..
tblContactTypes which defines each of the 10 types of job contacts. fldTypeID: fldTitle fldClient fldInternal 1 Contracts True False 2 Engineer False True 3 Other True True
The Job Specific data is stored in tblJob_Contacts
fldJobID (PrimaryKey) fldTypeID (from tblContactTypes) fldEEID for Internal Contacts (from tblEE) fldContactID for External Contacts (from tblClientContacts)
My question is this...How can I force the user to enter the Contact information for Contact Types 1,2,3, and 4 while leaving the remaining contacts types as optional?
I would like a form with combo boxes for the first four Contact Types which must be assigned for every job and then a continuous subform where the user can assign the remaining contact types if needed.
Initially, I planned to store the first four Contact Types as separate fields in the main table (tblJob) - however, distribution lists are needed and it makes more sense for all the contact information to be stored in the same table.