473,396 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Auto populate information in table 2 when updates occur in table 1

I have two tables. One user table and one ID table. The ID table is fairly static. What i want to do is add a user to the user table and then automatically assign the first available ID from the the ID table. When a user is deleted from the user table, I want to clear the ID that the user is using and make it available for new users as they are entered in the system.
Some additional information. ID's must be assigned based on select criteria (groups). Each ID is assigned to a specific group. I don't think the criteria are the important part (but I could be wrong). What I'm not understanding is how to automate the assignment/update portion. Thanks in advance.
Jul 25 '14 #1
7 1165
twinnyfo
3,653 Expert Mod 2GB
Johnny,

I may be a little confused by your language. In my world when we talk about "ID", we typically mean the primary Key or a unique record identifier that makes each record unique. If this is what you mean, then I would ask why you must keep the same ID for new records.

If this is not what you mean, but that "ID" is merely some form of identifier that is specific to a particular group in your administration, then that is another thing.

If it is the latter, then your code would search for the first record assigned to the group the user is assigned to which has no user associated with that ID, then assign that user the ID in the user table and assign that ID that user in the ID table.

However, this is just a rough guess, as I don't know how your tables are aldi out and what other criteria you are using to find these IDs.
Jul 25 '14 #2
Seth Schrock
2,965 Expert 2GB
Some more details about the ID are needed. What makes it the first available one? Numerical order, date it was made available, etc. Also, we need to know what the fields are in each table.
Jul 25 '14 #3
Hi. First - thanks for the quick replies and helping me understand what I'm missing. Let me see if I can elaborate. The user table uses an employee number as the primary key. The ID table contains a static list of badge ID's. We want to automatically assign a badge ID to new employees in a 1:1 relationship. I am thinking that the E# becomes a foreign key in the Badge ID table. The badge ID's should be recycled to the end of the assignment list such that a badge ID unassigned today is placed as the last badge ID when a new assignment occurs. Please forgive the newbie questions - willing to bet this is easy.
Jul 25 '14 #4
To confirm... It's the automatic part I'm struggling with...
Jul 25 '14 #5
twinnyfo
3,653 Expert Mod 2GB
You are correct on the Employee number beinga Foreign key--your already getting the hang of it.

You could add a date field to the Badge ID Table, then look for the oldest available badge.

To help, we kinda need to know how you are working your badge assignments. There is not much to go on. Are you using a form? Have you built anything that we can troubleshoot yet?
Jul 25 '14 #6
Right now I have the basics of the tables set up. I don't have a form built at this point as one additional thing ( that I likely should have mentioned) is that we want to complete the inputs in bulk. The plan was to create our tables and house them in a sharepoint list. It's easy to copy and paste in employee numbers into the user fields. Do I need a form to do this? Do I need to write code that checks each employee for an assigned badge if I go the bulk method?
I apologize in that I feel like I'm asking the wrong questions because I know so little.
Would I have to have VB written to populate the foreign keys automatically? I'm just not sure where to even start the research on this.
Jul 25 '14 #7
twinnyfo
3,653 Expert Mod 2GB
Your first question implies that you are not batch updating, but updating on an as needed basis:

When a user is deleted from the user table, I want to clear the ID that the user is using and make it available for new users as they are entered in the system.
Some additional information. ID's must be assigned based on select criteria (groups). Each ID is assigned to a specific group. I don't think the criteria are the important part (but I could be wrong). What I'm not understanding is how to automate the assignment/update portion.
I guess I am confused on the batch update issue....
Jul 26 '14 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to...
2
by: keri | last post by:
Hi, I'm still struggling with my tables - frustrating. If a field in table one is completed I want the following field to auto populate (dependng on the answer to the first field). I have...
2
by: alphaomega3 | last post by:
OKay here is the situation. I am creating an inspection log database and have previously created an Non-conformance database. I am trying to get the NCRno field to auto-populate after I update the...
10
by: BNicholeN | last post by:
Hi I need to know how to get a form to auto populate, i.e. When I pick a city from Center Location, I would like the Operations Manger and SVP to populate once a selection is chosen. A related...
5
by: joshua.nicholes | last post by:
I have an access database that consists of two tables.A data collection table and a species list table. The data collection table has about 1500 records in it and the species list has about 600....
18
by: kickergirl | last post by:
I have created a form that requests basic demographic information on a training participant as well as information on all the training the participant has taken part in. The demographic information...
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
2
by: Ronald | last post by:
I hope somebody can help. I can't get into the specifics of my project, but I'll try to create a simple example: tblVehicle * VIN (text box) * Make (text box) * Model (text box) frmRepair
5
tsubasa
by: tsubasa | last post by:
I have a form in ASP.net that has a checkbox option to auto populate the form with the user infomation that is held in an table. When I select the checkbox the auto populate works well with texboxes...
5
by: jamtakjohn | last post by:
I am fairly new to Access and in particular to Access 2013. I have created a database that uses a table to store information about students, including two multiple select fields. I have then used...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.