Linking Forms (and Automatically Creating New Record)

Apr 26, 2006

Please forgive me if I don't explain everything properly, I am relatively new to Access.

I have two tables with the following information:

VOLUNTEER
PK: volunteer_ID (autonumber)
name, address, school, etc

SCHOLARSHIP
PK: scholarship_ID (autonumber)
description (text)
amount (currency)
FK: volunteer_ID (number)

One scholarship can be awarded to only one volunteer.
I have a form to enter all the volunteer information. At the bottom of the form, I would like to place a button to open a new form to award a scholarship to this volunteer. I believe I need to link the forms in the following manner:

VOLUNTEER.volunteer_ID = SCHOLARSHIP.volunteer_ID

The problem is this: The forms are not linked properly because in order to assign a volunteer to a scholarship, the scholarship must already exist. So when I click the button to open the scholarship form, the scholarship form is empty and the volunteer_ID defaults to "0".

I think this could be fixed by somehow making my button create a new scholarship_ID in the scholarship form and THEN linking the volunteer_ID fields.

Does this seem like a solution? If so, how would I implement it? I have a screenshot to help. Thank you in advance for your help.

View Replies


ADVERTISEMENT

Linking To Similar Records From Same Table When Creating New Record - Call Log

Apr 21, 2014

I have been looking around for a while now to learn how to show in a subform similar records from the same table, and a way to link them together.

I work for a mental health organization and we have a call log database that we create a new record every time a person calls us - this allows us to track the outcome of these calls. Over the last 3 years we have about 10% repeat callers. I am trying to find a way, when creating a new entry, to see if this person has called before, and if they have, link their past contact (record) to the new contact (new record).

For example.

Caller: John Smith (555) 555-5555 (this is the new record)

in the subform, a list would populate all the 'john smith' records with an option to link or attach them to the new record.

View 8 Replies View Related

Re-linking Tables Automatically?

May 3, 2005

In our company, passwords expire every 90 days (NO EXCEPTIONS) for DB2. This means that all my linked tables can't be accessed. There are many other users using the DB's and when I have to reset my password, I get locked out a lot because I can't seem to re-link the tables fast enough. It also seems that "refreshing" the tables from the Linked Table Manager doesn't work very well.

Is there an easier way??????

View 14 Replies View Related

Forms :: Automatically Add New Record If Field Is Equal To Certain Value?

May 26, 2014

A have an OrderDetail form where I add the articles to a specific order. My articles can be ordered with 4 different attributes and one of them cost more than the others. If they want the article that cost more, I would like access to add a new record with some information.

also:
4 different attributes to my articles. (A, B, C, D)
if ArticleAttribute = A then Null
if ArticleAttribute = B then Null
if ArticleAttribute = C then Null
if ArticleAttribute = D then add NewRecord with ArticleId = X

View 14 Replies View Related

Forms :: Get Some Fields To Show Automatically On The Next Record?

Mar 31, 2014

1.) I need the formula to calculate 15% in a new field from an an existing field.

Something like: =([15%] of [price])

2.) How can I get some fields to show automatically on the next record?

View 12 Replies View Related

Linking Tables W/automatically Created Value

Nov 22, 2005

Don't know where this question will rank. Completely weird or completely common.

I've been getting great suggestions from this forum, one of them was to begin creating seperate tables for our data (I'm currently cleaning up a mess created 10 years ago for a nonprofit). The best way I have found to link/associate/whatever tables is to use their STUDENT identification number (since this value never changes). So we linked tests to that number (many tests to each student) by entering each new test as a seperate item with a manually entered stu id. We linked TUTOR and so forth the same way. But now I would like to start linking some more things. Particularly INSTRUCTION HOURS.

The question I have is this. How do I automatically create a value in the HOURS table that links to the value (stu id) in the STUDENT table. So that every student (previous and new) will have ONE associated HOURS set each time new student data is entered.

View 3 Replies View Related

Modules & VBA :: Automatically Linking Database With ODBC Connection

Jun 26, 2015

I am looking to automate the process of linking my Access DB with an ODBC connection to an SQL DB with VBA (unless there's an easier way to do it?) - some sample code - if this is possible at all?

View 2 Replies View Related

Setting Up Basic Hospital Record System - Linking Forms With Patient ID Or Name?

Aug 21, 2015

I work for a charity in the Pacific. I am trying to develop a very basic patient electronic health record for a new hospital, to be used until we get a more comprehensive patient management system in place.

I have set up basic tables, forms, and a welcome screen.

The idea is that the doctor or nurse will start at the welcome screen. From there, they can either enter a new patient, or add a new patient encounter.

There are four types of patient encounters: assessment, treatment/surgery, refraction, and follow-up. I have made tables and forms for these encounters.

My issue is finding an easy way for the doctor or nurse to quickly and easily make sure that the encounter form they are filling relates to the appropriate patient. I already have a patient form, and patient ID field across the tables. But I would like to be able to add a 'search for patient' button on each of the encounter forms (or any other relatively easy method) to make sure everything lines up.

Database draft.zip

View 6 Replies View Related

Linking Excel To Access Automatically - Publishing Daily Report?

Dec 6, 2012

Having experimented with Access for a few months now; I know you can link an Access Database to SharePoint, and you can export Excel files into Access for inclusion in tables.

My question is; If I have a daily report being produced, through script, with an excel output. Is there anyway to automatically publish this in Access, negating the need to manually go into Access to import?

View 5 Replies View Related

Automatically Filling Linking Fields For New Rows In Related Table?

Dec 18, 2012

OK, so I have a database with four tables (Well, more than that, but these are the relevant ones). It's to be used for recording the results of site inspections.

"Tbl_Typicals" is a list of products. We'll call its key "Typical_ID".
"Tbl_Actions" is a list of tests performed on each product. A given product may have many tests, but each test applies to only one product. Its key is "Action_ID". Each row contains a Typical_ID to link on.
"Tbl_PlantComponents" records which products are installed on which site. Its key is "Component_ID". Each row contains a Typical_ID to link on.

The fourth table ("Tbl_Results") contains the results of each test. As a result of the relationships above, each row is specific to a single Action which applies to a particular PlantComponent, which is to say, each row has both a Component_ID and an Action_ID to link on.

So, what I need is a query that pulls all of these together, such that I can use these details as the line items of a subform.

The main form displays the details of the PlantComponent, which is a simple query to relate line items in Tbl_PlantComponents with the data about that particular product in Tbl_Typicals. So far, so easy.

The subform shows the details of each test applicable to that product. It then has toggle buttons and a comment field to indicate the results of the test, the results of which should be stored as a line item in Tbl_Results.

The "easy" way is to use an append query to generate Tbl_Results in advance. This works, but it raises a variety of new issues.

The nice way would be to use a normal SELECT query and have Access fill in the necessary linking fields (the Action_ID and Component_ID) on each row automatically. Now for trivial examples, this is very easy - my main form query manages just that: I created a link between Tbl_PlantComponents and Tbl_Comments (which stores general comments about each PlantComponent which aren't related to a specific test) based on the Component_ID and that works fine - when I edit the Comments field, the row is automatically created and the linked ID field filled in for me.

However, when I need to do it with 2 links, it all falls apart. I've tried everything I can think of, including generating a single-column unique ID to use for the link, but Access just won't autofill for me. It just makes those fields on the form (or in the datasheet view of the query) non-editable because there's no associated row in Tbl_Results. If I create a matching row in Tbl_Results the query works fine, but that's not the point.

Implementation of the query is non-trivial because it requires two outer joins involving 3 tables - All from Tbl_Actions to matching in Tbl_Results, and All from Tbl_PlantComponents to matching in Tbl_Actions. This necessiates splitting the query into two - the first relates Tbl_PlantComponents, Tbl_Typicals and Tbl_Actions (returning one row for each Action for every Component), and the second performs a single outer join (using an AND) between the first query and Tbl_Results.

View 5 Replies View Related

Forms :: Stop TAB Creating New Record?

Sep 16, 2014

But I use one for creating new records in a table.

And one to View/Edit exiting records.

When I open an existing records, and tab through the fields. Once I pass the last field it creates a new record.

View 2 Replies View Related

Automatically Creating A Primary Key Without Autonum

Jun 2, 2005

I'm pretty new to access and I've been working on a pretty complex project...

Anyways, my first problem I'm having is that I want Microsoft Access to automatically create a key number. This number depends only on the year, and then it would concatonate another number.

Example: 5-3000, then 5-3001, 5-3002... The five corresponds to the year, and the other part is just incrementing by one for each new record.

What would be the best way to do this? I don't necessarily need the dash in there, it could simply read 53000, 53001, 53002, etc.

Thanks for the help!

View 8 Replies View Related

Creating A Form And Linking To The Table

Jul 11, 2007

Hi Team,

I want to create a form which will act as an outage tracker. I will be having 2 kinds of tables.

1. Type of leave
2. Headcount with employee schedules
3. Goals for outage

Please find the scenarios

1. In the front end as soon as the Team Manager selects his or her name the next combo box should show the names of his agents.

2. Once the user selects the date of leave, if the leave is being marked 48hrs in prior and the total outage is less than the goal then it should show the planned leaves options as per the leaves saved in the "Type of leaves" table or else a message box should pop-up stating the reason for not showing planned leaves options.

3. Also the form should show the %outage marked on the tool for the week.

Need your help as I am pretty new with access.

Regards,
Malay

View 3 Replies View Related

Forms :: Information Not Retained Within Subform When Creating A New Record?

Jan 20, 2014

I have a form and a subform.

When I click on the command button to create a New Record and then type the customer details in the Main Form and the Order Details in the Subform, the information is not retained

i.e. when I close the Form and then re-open the Form the orders details are not saved but the customer details are.

When I re-enter the order details the information is retained this time, everything seems work ok second time round!!

View 4 Replies View Related

Forms :: Creating A New Record From Another Form And Passing Values?

May 20, 2014

Have a form that contains fields AssociatedProject, AssociatedRelease and then the user hits a button to create a new record and a new form opens to display this newly created record which sets the fields and also sets a field called Type. There is no issue with setting the field values and the new record is created. However, when the form opens to display the record it displays another record instead (usually the one before it). I think it could be related to the fact that the db resides on a shared drive which periodically has slow connectivity. However, I'm looking for a solution, perhaps modifying the code?

Here's the code:

Private Sub Command17_Click()
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim ctl As Control
Dim varItem As Variant
On Error GoTo Err_Command17_Click
Set db = CurrentDb()
Set rs = db.OpenRecordset("Tbl_Main", dbOpenDynaset, dbAppendOnly)

[code]....

View 6 Replies View Related

Forms :: Access 2010 - Creating A New Record In A Subform?

Apr 12, 2014

I am trying to create a database to manage IT assets, most of the structure is done, I'm now trying to get the details done.

The issue I am currently trying to tackle is to get a control button on one form to create a new record in the sub form that sits in the main form via another pop-up form.

So I have :

>PeripheralsViewForm - that has 4 control buttons (Edit Quantity, Edit Description,Add an Item and Exit)

>> PeripheralsSubForm - (Datasheet) which is referenced to PeripheralsQuery

The Edit Quantity and Edit Description open a separate form which allows the user to update only the quantity or description respectively (I have done it this way rather than allowing edits in the data sheet as I feel that it is too easy to hit a key incorrectly and overwrite data in the datasheet view) Both of these functions work perfectly (to my amazement) - I am using the id field in the subform to link to the pop-up form which then has unbound text input boxes, which I then write back to the subform.

e.g from edit button on click event: DoCmd.OpenForm "perquantform", , , " ID=" & Form.PeripheralsSubForm!ID and then from the pop-up form "perquantform" on the "Exit & Save" button I have :

Forms!peripheralsViewForm.PeripheralsSubForm.Form! Quantity = Me.newquant DoCmd.Close acForm, "perquantform", acSaveYes

This allows the user to select the record in the datasheet form and then click either the change quantity or description button.Also also the other reason I did it this way was because I just couldn't get the subform to requery when I had the two edit popups linked to the table or query.

The problem now is that when I click on the "Add an Item" button, it overwrites whatever record is currently selected !

The code I have is this:

From the "Add an Item" button on click action:
DoCmd.GoToRecord , Forms!peripheralsViewForm!PeripheralsSubForm.Form! , acNewRec
DoCmd.OpenForm "addperform"

And from the form "addperform" - "Save & Exit" button on click action:

Forms!peripheralsViewForm.PeripheralsSubForm.Form! PerType = Me.pertypedrop
Forms!peripheralsViewForm.PeripheralsSubForm.Form! PerMake = Me.permakedrop
Forms!peripheralsViewForm.PeripheralsSubForm.Form! PerModel = Me.newmodel
Forms!peripheralsViewForm.PeripheralsSubForm.Form! PerDescription = Me.newdescription
Forms!peripheralsViewForm.PeripheralsSubForm.Form! Quantity = Me.newquantity
DoCmd.OpenForm "PeripheralsViewForm"
DoCmd.Close acForm, "addperform"
--------------------------------------

the line "DoCmd.GoToRecord , Forms!peripheralsViewForm!PeripheralsSubForm.Form! , acNewRec" is what I have added to try to solve the overwrite issue, but when I run this it comes up with the error :

"runtime error 2498 - An expression you entered is the wrong data type for one of the arguments"

I have put this line in the "addperform" exit action and it comes up with the same sort of error.

Using Access 2010.

View 14 Replies View Related

Creating Equipment ID's Automatically From Departmental Info

Jan 17, 2005

Hello,

I am starting to get further into access development, originally i started from a sample database and have been teaching myself as i go along. This database has come pretty far and the farther it comes along the more my company demands of me from it!

either way, it is basically a database that holds all of our asset information, equipment parts, workorders and preventative maintenance. We've been plugging along just fine but I want to help their productivity and have access automatically create "Equipment ID"'s from information that is entered by the person adding an asset. I would like it to create an ID from Entry of the Department, Location, and then a 4 digit Autonumber after that.

Basically we have a few basic departments, IT, Facilities, etc. and a few locations... So we have been setting our equipment ID's like this:

AA - Two characters for the Location
BB - Two characters for the department
0000 - numbered field

So I really would like to be able to create these automatically instead of manually typing them in to a text field with an input mask.

AABB-0000 to automatically create entries from the departmental info, location info and then automatically create a 4 digit number in order to follow it.

What is the best way to do this? Keep in mind I am just barely able to do any code, I only have been going from what i see in the database and building upon it and learning a few bits and pieces of code from there. So if you start going into a code explaination go slow~!

Thanks,
Jim

View 4 Replies View Related

Forms :: Creating Required Field In A Form Before Moving To Next Record

Feb 5, 2014

I have created a Form based from a Table. On one of the fields, I need to be required inside the Form before moving to the next record of that form. I can not make the required field in the table, because I have to append information day to day.

Also, the required field is a combo box option that is limit to the list.

What kind of Code I can do inside the form of the specific field to make it required before clicking onto the next record. It does not matter if the processor closes out of the form before updating, only if moving to the next record.

View 5 Replies View Related

Forms :: Creating New Records On A Form With A Query As Record Source

Mar 29, 2014

In my database I have a form who's record source is a query. That query is based on a table, and have set a criteria on one of the fields.

When I use the form to add a new record I want the value of the field in question to automatically be what I have specified in the query.

Instead, the record is added but without having that value in the field, and when I go back to the form it doesn't display the record because it doesn't meet the criteria specified in the query that the form is based on.

View 2 Replies View Related

Forms :: Creating Record From Subform - Use One Of Values In Main Form

Apr 5, 2013

I'm trying to create a record for a table that has 2 attributes:

ContainsTracks
+album
+tracks

I have my main form, where the album is determined by a TextBox. My subform has a textbox that lists the tracks (in datasheet view). I have this set up and working fine.At the moment if I try to add a new record by typing a new entry into the subform I get the error: "Index or primary key can not contain a null value". This is because both album and tracks make the composite primary key of ContainsTracks.

My question is, how can I tell the subform to grab the value from TextBox1 in the main form as the +album when I create a new record.I have provided two screenshot that perhaps explain my predicament a bit better

View 2 Replies View Related

Forms :: Creating New Record In Subform - Button To Add New Object To Main Job

Jul 1, 2013

What i'm trying to do is add a new record to a subform. The problem is, I couldn't use a subform based on a table in order to achieve this. I needed extended information for it to be useful, so I made the visible part of the subform based on a query instead.I'd like to add a button that adds a new object to the main job. I'd like the adding of that button to call a new form allows you to fill in the information for that object (this called form actually contains 5 subforms to populate all the data of the object). That form works.

What I need is for the button to call the 2nd detailed form AND create the necessary entries in the project/object junction table.The idea as it is now is a button on the main form, but if it was possible to do so via continuous form in a subform, that's doable.

View 11 Replies View Related

Forms :: Creating Duplicate Record With Specific Fields Blank

Jul 21, 2014

I'm working on a form with almost a hundred various fields (it's what my employer needs). He wants to be able to create new records with much of the same information as the old ones by clicking on a button that will copy the information to a new record, then clear certain specific fields (or some process that will safely create the same result). I don't need specifics on how to write the same line of code for each and every field I wish to clear.

Say I have a form with 5 fields: part_number, part_owner, procedure, file_name, and date.

How could I copy the record to keep the fields part_owner and procedure the same, but clear part_number, file_name, and date?

All of the fields are from the same table (no, it's not normalized...).

View 14 Replies View Related

Automatically Creating Invoice For Customers Based On Set Parameters

May 8, 2013

I have a database that I will use for invoicing, but I would like it to automatically create an invoice for customers based on parameters set for that customer (e.g., monthly, biweekly, etc.). I have tables containing the customer information, the item they are being billing, the price, etc. I want to be able to have access automatically create the invoices and add them onto the invoice table each month.

Maybe there is a better way, but I thought that if I created a query for all people that are billed biweekly and all people that are billed monthly, that I could run the queries when applicable and then somehow write a macro that would go through the list of customers and add each of them to the Invoice table and add an autonumber. That way I could click run query, run macro, and then do my invoicing. I don't know if that is the way to go or not.

View 8 Replies View Related

Forms :: Creating User Record - Input Multiple Tables From Form

Mar 28, 2015

I am building a form to create a user record and at the same time i have some yes/no options which are located in other tables but when i want add a user i cannot select any yes/no options they seem locked?

View 1 Replies View Related

Forms :: Creating A Form Which Copy Selective Entries From Previous Record

Dec 10, 2013

I am tasked with creating a scientific database of fish catches at various different sampling stations. I envisage the entry form having hierarchy levels, ie year, season, date, sample station, species caught, and then the specific associated data with each species (weight, abundance, length etc) will form each distinct record.

In each year there are 2 sampling seasons. In each sampling season there are up to 20 dates on which samples are taken. On each date there are up to 50 sample stations recorded. And at each station up to 20 species can be recorded.

In order to enter each species caught in a survey, the end user will potentially have to fill the season box with an entry 40,000 times. For each season there will be 20,000 date entries to be made. For each date, 1,000 station code entries, and 20 species entries for each station. What I would like to happen is this.

When the end user is entering the data, he or she will be working through the hierarchy from the ground up. Ie., they will enter a particular species' data (abundance, weight, length etc) at a particular station on a particular date during a particular sampling season. The next entry will be a different species at the same station on the same date during the same season. I would like the duplicated information from the previous record to be copied across onto the new one so that all the end user has to do is enter the species name, abundance weight and length data.

Once they have finished entering all the species data for that particular site, they can move onto the next site which they would fill in the data themselves for the station code. So, in the hierarchy, the first button would copy all the previous data except the species name and associated weight length abundance data. The next button would do the same, except leave the station code blank. The next button would leave the species name, station code and date blank. And so on up the hierarchy. The end user would be able to selectively choose which data is copied over by using these buttons, saving lots of potential extra work doing repetitive entries.

View 1 Replies View Related

Forms :: Stop Access From Creating New Record When Inputting Data In Field Or Tab

Dec 17, 2013

How do you prevent access from adding a new record when u input data in the current record or tab to the next field? My database is set up to open with a form where the user picks his name and then a week ending date once that is complete u open a new form where the name and date auto populate along with other fields to fill out such as job charge, charge type , times charged for each day of the week. But I don't want access to create a new record everytime the person inputs or tabs..... .

I have attached my database for better clarity!

View 9 Replies View Related







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