Forms :: Creating A Specific Relationship

Nov 18, 2014

I have started a new project where I have tables of people, organization, and roles, as well as one that is supposed to contain the relationships among them. In all four tables there is an AutoNumber ID field as the primary key. The fourth table, the relationship table, has as foreign keys, the primary keys from the first three.

I have created a form with a combo box for each of the three main tables. The intent is for the user to select a person, an organization, and a role, and then click on a button control that will create the relationship in the relationship table. What I am trying to do in the code is, using an AfterUpdate event procedure for each of the combo boxes, open the appropriate table as a recordset, find the selected record, and set a form-local variable to the value of the ID field for that record. So far, I can't get past the first combo box. Here is the code I have written, including both the form variable declarations and the AfterUpdate code:

Option Compare Database
Dim personID As Integer
Dim orgID As Integer
Dim roleID As Integer
Dim rsPerson As Recordset
Dim rsOrg As Recordset
Dim rsRole As Recordset
Dim rsRel As Recordset

[code]...

The error message I get is Compile error: Object required, with the personID reference in the last statement highlighted. (qryPerson is a query based on tblPeople that combines first and last names into LNFN.)

View Replies


ADVERTISEMENT

Forms :: Creating Parent / Child Relationship Within Form

Apr 3, 2013

I have a relationship between two tables; the parent table is "Client Information" with a primary key of "Client_ID", the child table is "Event Information" and the foreign key is "Client_ID".

I know that within the Event Information table I can select which Client_ID to use as the link. I want to have that done within a form, however. I have a form for Client Information with a subform for Event Information. If I go into the table and manually set the Client_ID then everything displays fine.

How can I set the Client_ID in the subform to automatically match the Client_ID in the main form? I can only assume that these solutions require the parent/child relationship to already have been established.

View 4 Replies View Related

Forms :: Creating A Form / Relationship Combo Box To Suit Tables

Jul 8, 2013

I've been tasked with creating an Access database..We have a main table that includes information found on every lease, however there are 3 leases types. Each which lead to another table or two. Basically, I want to create a form that allows me to link the main table with the corresponding variable tables.

View 1 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

Help With Creating A Relationship

Jul 2, 2007

I have a table with all the job information for each of our jobs. I want to create another table with a job notes field that is linked to the job info table above. My main goal is to be able to make a query or report for the job notes on all our jobs on a specific date.

the query will look like this:

job # field, job name field, job notes (july 3) field.

Q1. Is there a way to link the job info field with the job notes field where the job # and job name information will automatically populate into the query?

Q2. How do I build a relationship between the job info field and the job notes field.
I tried to link them, but when I do the query the job # and job name fields aren't being populated, it only shows a single blank row for the whole query.

Thanks!

View 1 Replies View Related

Help Creating Relationship....

Dec 8, 2007

Hi,

Can someone please help me take advantage of this handy piece of work I found on the forum?

I need to implement a picture management app for a database I am developing and this (Attached) app looks to be exactly what I am looking for.

Here is what I have been trying to do.

Use the attached tables, and forms to create a one to many relationship in my exisiting database.

I have a PK of OrderID in my existing database.

I have the table, form and mod in my existing database but I cannot seem to get the relationship down..

Any assistance is greatly apprecaited.

Fen How

View 3 Replies View Related

Creating One To Many And Not One To One Relationship?

Nov 1, 2014

I have a database assignment where I need to link some tables. One is a table with a composite primary key and the other is a table with a regular primary key. The composite key is already linked in a one-to-many relationship with the first of its two fields; the problem is the second field also needs to be in its own one-to-many relationship with a different table. Access keeps creating a one-to-one relationship. I need it to be a one-to-many relationship.why this might be happening?

View 1 Replies View Related

Relationship Woes With Specific Query

Mar 9, 2006

I have a pretty standard relationship set up, with the following tables:

Customers: A row/Cust ID for each customer
WorkOrders: each customer can have multiple work orders (linked to Customers by CustID, individual ID is WOID)
Jobs: each work order can have multiple job records attached (linked to WorkOrders by WOID, individual ID is JobID).

As far as I can tell, they're fine and all other forms etc work, updating no problem, referrential identity is enforced etc...

Problems: When I go to make a "job allocation" query for subsequent form, I select: Customers, Work Orders and Jobs table (I then filter by location, but
this problem remains unfiltered also). They link up fine. The query isn't nonsensical either - it lets me add new data. BUT instead of showing all the customers and work orders for the location due for the location, it will ONLY display the records that have details in the Jobs table (the lowest in the relationship chain). Basically, If the jobs sections are empty or "unattempted", then NO details AT ALL will show up in the query. Which is a problem, because I want to see ALL the "unattempted" jobs in the area to allocate them, including customer data and work order numbers. I also need to have the jobs table present, so I can allocate a job date, a contractor etc.

I'm not sure what to do. As far as I can see, the set up I have IS very standard tables/relationships-wise. I have to work it out, otherwise I'm going to have to revert to some kind of 'super-table' (like in our old system) - which I am at loathe to do - I don't want to merge Work Orders and Jobs because that means a lot more typing for me.

Would cascade update in the relationships do anything? (it is checked).

I've been away from Access for awhile and I'm just drawing a blank on this one. Any help greatly appreciated. Thank you.

View 2 Replies View Related

Populate Data After Creating Many To Many Relationship

Apr 17, 2014

I have about 600,000 records in an excel sheet and tried using the table analyzer but I run out of memory. Instead i have broken up my giant table into a few other tables with their own primary keys and have populated from a maketable query. I related the tables together in a 1 to many and many to many table and one of the subforms is working great. The problem i am having now is with the many to many table (WorkedJunctionTbl). I don't want to have to manually input thousands of lines of data, so is there a way i can populate the data from the original data correctly using the new autonumber primary keys?I can't seem to get an append query to work correctly.

View 8 Replies View Related

Difficulty Creating Form – Possible Relationship Problems

Jul 26, 2005

Hi, I’m having a problem creating a form for easy data entry. Let me give you a little background. I have a database for a tutor program, students request a tutor for a class, and then I fill out a follow up report to find out if they are being tutored or changed their minds. Next I enter the contact information indicating the date and time of their tutoring session.

Students can be tutored in more than one class but they can only have one tutor for each class.

I have a form where I enter the tutor request info and sub forms for their classes, follow ups, and sessions. Ideally I would also like a form just to enter the session info. I want a combo box to select the tutor and then a sub form to select the tutee with a combo box which will auto fill the Subject, and Course fields, and field to enter the date and contact hrs.

I think the problem is with my relationships. I’m just kind of stuck. I think I need to create a form based on a query but I haven't done that before. Any help would be appreciated. Attached is a screen shot of my relationships and of my current form for your reference.

THANKS!!!!

View 1 Replies View Related

Need Some Tips In Creating Relationship Join Lines Between Tables

May 16, 2005

Hi, I am new here and need some help with MS Access97. I am looking for a more convenient way to join tables together. The usual way that I know is to drag the field(s) in one table and drop it in the other table (within the relationship window).

Is there any other way that I can do the same without drag and drop (keyboard instead of mouse)? This is real problem to me when I need to do some modification and have lots of tables scatter across few pages and the vertical scroll of the Relationship window is not working properly with drag & drop technique.

Please help. Many thanks! :)

View 2 Replies View Related

Tables :: Creating Relationship Table From Clients To Orders

Feb 4, 2014

I have a Client database table in Access. I now need to add a simple order table (related) to the client table. I have a client ID field set to autonumber in the client table. As I start to create the orders table I'm not sure how to link the two so that I'm not entering data twice and have assurance that they are tied together.

View 4 Replies View Related

Creating Relationship Based On Part Of A Text Field

Jan 27, 2014

Each each record in table1 has a unique four character (alpha-numeric) code to identify it. The first two numbers of this code represent the group it is in. (Ie. 15AB and 1502 are both grouped together) The second table stores values that apply to the entire group. I need to create a relationship between these two tables based on the first two characters in the ID field.

Things I've tried:
* Making a calculated field with left$() formula - Access doesn't allow relationships on calculated fields
* Create a new field for just the first two characters and create a data macro for after update and after insert to update that field with the expression - cannot edit the field the user is on

View 4 Replies View Related

Creating An Autonumber To A Specific Format

Oct 19, 2006

I need to create an incrementing number to be used as a primary key in a table, based on a few variables. The format will be YYMM0000. It represents the number of units received each month.

I can come up with the formula to create that string no problem, but I need to create some code to check the table MAIN for the field TRACKER_ID to find the last number and increment it by 1.

Can anyone help? :confused:

View 2 Replies View Related

Need Help Creating A Query Using A Specific Critiria, THANKS!

Dec 27, 2005

Hello,

I was wondering if it was possible to show data sorted by date. But I only want to see the dates that are before another date in a different table. Is that possible? (So two tables of data; one date is on the first table, the other is on another table)

Thank you.

View 5 Replies View Related

General :: Creating Password Protection On Specific Tables?

Sep 20, 2012

I would like to know if I can create a password protection on specific tables. Within my database, there are certain tables and/or reports to be view by a selective amount of personnel. Can I password protect just that view?

View 2 Replies View Related

Forms :: How To Hyperlink From Query To Specific Record In A Specific Form

Jul 23, 2013

I want to hyperlink from a query direct to the relevant record in a specific form. I have a hyperlink field in the form which shows up in the query. When clicked in the query, this hyperlinks to the form but I cannot make it select the correct record in the form.How do I get it to select the correct record?

View 3 Replies View Related

Modules & VBA :: Creating EXE Or BATCH File That Executes Specific Excel Macro?

Jan 27, 2015

Is there a way to create some sort of an EXE or BATCH file in any Windows Explorer folder, that executes me a specific Excel Macro?

My problem is that I got several files split up by Departments, updated every day.

So far I have to open each file and update the format.

It would make my life much more easier if I could just run a file that opens each file and applies a format to them.

View 1 Replies View Related

Creating Dynamic Hyperlinks - Open Data Entry Form And Navigate To Specific Record

Nov 28, 2011

I have a form that lists records in a table. I would like to have a hyperlink beside each record that will open the data entry form and navigate to that specific record. Right now, the use can only open the form for all records and has to use the record navigation buttons to find the desired record.

View 1 Replies View Related

Forms :: Copy Specific Fields From Selected Record To Specific Fields In Subform?

Jul 9, 2015

I am new to access i have a problem which is i have made a form which contains a subform and a read only subreport, what i want is the ability to select a record in read only subreport as in the picture attached and make a button that when i press on it, it should copy the values of the itemsID field, Packing field, ContainerNo field and origin field from the selected record and then paste them in the subform below.

Also i want to add more then one item, so the when i press on another record it should paste the values below the first record.

View 12 Replies View Related

Creating A "Many To One" Relationship?

Feb 22, 2006

I'm a bit unsure how to do this.

Currently, I have two tables as

tblClients
ClientID(PK)
blah blah
blah blah


tblAdvocacy
AdvocacyID(PK)
ClientID (FK)
blah blah
blah blah

Clients may include those who needed advocacy services. Clients table counts by every visits, not by per person.

However, with advocacy, I need a mean of tracking actual person.

Right now, I have one to many relationship from client.clientid to advocacy.clientid, but seems to not be the right solution as I would get duplicate advocacy records when there should be only one advocacy record per person with many client records (as in visits).

The duplicates is created whenver a name is chosen in the combo box in the Advocacy form, to which a new AdvocacyID is assigned to the same person. It shouldn't have done that.

What I can do to ensure that there is only one unique Advocacy record that can be referenced by several Client records?

View 7 Replies View Related

Tables :: Creating Relationship Between Two Tables

Dec 11, 2012

I created two tables, but i don't know what kind of relationship i should create.

In the first table, i would like to put all different tests (medical tests, such as EMG test, and so on), in the second table, i want to add the settingup for each test, say, recording site, stimulating site et.al, then i want to use one form to populate data into these two tables, what should i do?

View 6 Replies View Related

Forms In OneToMany Relationship

Dec 13, 2005

I have 2 tables: TblCustomers (one) [field: MblNo; CustName] and TblDetails (many) [field: MblNo; TalkPlan; BillingAddress] with (1 isto many) relationship.
The TblCustomers has primary key [MblNo] that is foreign key in TblDetails.

They have 2 bound forms frmTblCustomers and frmTblDetails. Now frmTblDetails is inserted as subform in the frmTblCustomers.

I would like to keep on adding [MblNo; CustName] in TblCustomers and customer details in TblDetails (ie Talkplan, etc). Now, if I try to enter an already entered [MblNo] in TblCustomers it will not allow and generate error. But a customer may appear more than once in TblDetails (as he might keep on changing his TalkPlan or BillingAddress).

Any idea on how should the forms be built so that whenever I attempt to add an already entered MblNo in TblCustomers it will alert me that "the MblNo that you are attempting is Duplicate" and the focus of the control will be set to frmTblDetails so that I can contnue adding details in the [TalkPlan]; [BillingAddress].
Any help is appreciated.
Thanks.
Prodigy...

View 1 Replies View Related

Forms :: Implement Form For Many-to-many Relationship?

May 5, 2014

how to best implement a form for this very simple database (attached). I have a database that keeps track of just first names and colors. Not every first name needs a color assigned to it, and vice versa.

So, I have three tables:

tbFirstnames
First_ID (PK)
First_Name
tbColors
Color_ID (PK)
Color
jctbFirstColor (Junction Table)
First_ID (FK)
Color_ID (FK)

I want my continuous form (fmFirstColor) to show all first name records and have a drop-down to assign a color for each record individually. That's it -- two fields. With this form, I want to be able to create new first name records with or without colors assigned to them, and I want to be able to edit first names and change what colors are assigned for each name.

Again, very simple and small database, but I'm not sure where to run with this. I want to keep everything normalized and within best practice procedures. Is the junction table necessary or can it even be used in this instance?

View 11 Replies View Related

Forms :: Subform Relationship With New Entry

Mar 28, 2014

I have a Workorder Form that holds all the fields that apply to the entire project (payment, customer, etc).

Then I have a subform for Stock. This allows there to be several different stock items (and production information relevant to that stock) assigned to a Workorder.

I have successfully linked the two so that when a Workorder is opened, it shows any related Stock in the subform that has already been created.

The problem is new stock entries. I need it to only allow Stock additions to the current open related Workorder.

I currently have it where you can type in the WorkorderID (autonumber) on the Stock subform new entry and it will work. But I do not trust employees to type in the correct number every time they need to add stock to a Workorder. I can't release it this way.

I mean, the whole point is for the database to promote as little error as possible, right?

View 5 Replies View Related

Forms :: Presenting A Many-to-one Relationship In Forms

Apr 8, 2013

I am creating a database for a claims management company. They want a system where one customer can have multiple claims assigned to them. So as far as i know this means i need one table for the customer and all their details (tblCustomer), and another for the case (tblCase). I need tblCase and tblCustomer to have a many to one relationship....with referential integrity?

Ideally i would like to search to find a customer then have a very brief list of the claims they've had. with each claim being clickable for full info/ editing.

View 7 Replies View Related







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