Forms :: Next Record On Parent Form

Apr 18, 2014

I have a parent form tied to one table, and a subform in it that is tied to another table. The relationship is one-to-many, and if there is more than one record in the subform, when clicking next or previous, it scrolls through the subform items. I would like the Previous and Next buttons to move to the Previous or Next parent record, not the child records.

View Replies


ADVERTISEMENT

Forms :: Refresh Parent Form And Move To Next Record On Subform

Dec 10, 2013

I have two subforms on a "Page"/Tabs. Subform #1 is a continuous form which accepts data about dimensions of a pattern piece. The other subform needs to update its information display each time the last control of the first subform loses focus, because it tells me how much material is required for all pieces of this pattern that are entered.

My first feeble attempt at this was to add the following code to the "Lost Focus" event of the final control on the first subform:
Form.Parent.Refresh

This succeeded in forcing the second subform to re-run its calculation.

However, after the recalculation took place, I wasn't able to move to the next record on the first subform. This subform is a continuous form, and I need to be able to add another row of data and then see the second subform change based on the additional information in the first subform.

Obviously I've done this wrong.

View 1 Replies View Related

Forms :: New Parent Record When Clicking On Subform

Jun 5, 2015

I want to force an autonumber field on a parent form to start a new record when clicking on a subform, so that value can be passed to new records in the subform. Is there a simple way to do this?

I'm using Access 2010. I have a parent form based on a query that does not have any fields intended for input but has an autonumber ID field. The subform is based on a query that finds records based on the ID field in the parent. When the parent ID field has a value it works perfectly, including adding new records in the subform. When the parent ID field is blank, though, I can add new records in the subform but the ID field does not populate.

I made a workaround by adding a Yes/No field to the parent and its query that users can click to create a new record, so the ID field has a value to pass to the subform. This works fine, but I feel like there should be a better way to do this without user clicks.

Via VBA, I've tried setting the parent form to dirty, and setting the Yes/No field to Yes, along with a variety of less likely candidates like refreshing and requerying. I've tried the above on various events including the parent LostFocus; the subform Got Focus, On Click, On Mouse Move; and the same events for control on the subform.

At this point I'm not sure whether the problem is my event choice, or the object method I'm using, or just the syntax for my control references. Or maybe this is actually more complicated than I think and sticking with the checkbox option is the best way to go.

View 6 Replies View Related

How To Add New Record From A Form To All Parent And Child Tables

Jul 27, 2015

I have one parent table with 6 child tables (all child tables are linked to the parent table in the relationship through the BoardID autonumber field, and they are all one-to-one relationships). All of the tables feed into one form. I have added the "add new record" button to the form, but when I click on it, it only adds a record to the parent table. The only way I have found to solve this is to go into each individual table and add a new record. Is it possible to have a new record added to every table when I click the "add new record" button on the form?

View 7 Replies View Related

Forms :: Subform Needs Values From Parent Form

Jan 10, 2014

In the detail of the parent form, there is a tab control block and each has subforms on them that are exactly alike for WorkOrder Notes, History, Specs When the Work Order subform is accessed (connected by SerialNumber, WorkOrderID and CertDate) the default WorkOrderID should default from the parent form, the SerialNumber should default from the parent form, and the CertDate should also default from the parent form.

What is the syntax to get these fields to default to the values parent form BUT not specifically referencing the name of the parent (because there are 5 differnt parent forms)?

View 6 Replies View Related

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 :: Update Parent Form After Subform Updated?

Mar 30, 2015

Parent form/table, with a subform (separate table, 1:M link on "ID") The parent form data stays fairly constant (occasional change/update), with multiple entries in the subform for each parent record which are added to more frequently The master table has a field "last interaction" which I need to update whenever a new entry is made in the subform/subtable It updates fine when I change an entry in the parent table/form, but not when I add a new subentry for that parent

View 12 Replies View Related

Forms :: Refresh / Save Field On Parent Form

Sep 4, 2013

I need to refresh listbox field (Total_price) situated on parent form. My sub form is called "Lines_form". I want to sum values of all lines for column "price". Result of calculation I want see in parent form in field "Total_price". My parent form is called "Main_form".

On "price" field settings I used AfterUpdate event : Me.Parent!Total_price.Requery

I see result in parent form, but value isn't saved to table and I can't use it in next calculations.

I need refresh/requery/save patern form. I try this code:

Me.Parent.Form.SetFocus
Me!Parent.Form!Total_price.SetFocus
DoCmd.RunCommand acCmdSaveRecord

but it doesn't work.

View 3 Replies View Related

Forms :: SQL For Combo Using Text Control From Parent Form

Jun 22, 2014

Private Sub cboConsulta_GotFocus()
Dim strsql As String
strsql = "SELECT ID_Verificacao,Verificacao FROM tblVerificacao WHERE ID_Peca = '" & Parent!TxTId_Peca & "' ORDER BY Verificacao;"
Me!CboConsulta.RowSource = strsql
End Sub

Message Box: Data type mismatch in criteria with data

field ID_Peca = number

TxtID_Peca = receives from field = number

View 2 Replies View Related

Forms :: Fill Datasheet Subform Based On Selection In Parent Form?

Dec 6, 2013

What I have is a form that takes in information regarding test data. Each test run can record data for multiple requirements. I am able to pull all data fine, however in order to make it easier on the user i was hoping to populate the requirements subform based on a selection of "test group" in the main form.

Commonly run together requirements can fall in to groups. I have a selection box for these groups in the main form and a table that stores these group id's and group setup. Is there a way to autofill the tables records that the subform is linked to based on the selected test group?

View 3 Replies View Related

Forms :: Delete Records In Subform Based On Check Box In Parent Form

Mar 1, 2015

I have a parent form and connected to it is a subform. On the parent form I have a checkbox which enables and disables fields on the parent form and also hides the subform.

What I want to do is when the user unchecks the checkbox, this action also deletes the associated subform records, if there are any.I'm sure that this can be done with an SQL Delete query in VBA.

View 5 Replies View Related

Forms :: Auto Populate Subform Based On Selection In Parent Form

Apr 30, 2015

I've got a Parent form (frmProspectDetails) with a subform linked (fsubProspectSkill).

This form is for users to enter general information on a prospect (names, position, height, weight, etc) on the parent form and skill levels on the subform.

Currently the subform is set so the user has to manually select the specific skill set for the prospects position, and then enter a value for each skill level(1-99).

I'm trying to get the subform to auto populate with a specific skill set based on the position selected in the parent form, so the user only needs to input the skill level without selecting each specific skill.

This data is then stored in a table (tblProspectSkill)

To add, I've created a form (frmPosition) that lists the specific skills set for each position.

I'm not sure how to get this subform (fsubProspectSkill) to auto populate with the specified skill set from frmPosition.

View 6 Replies View Related

Forms :: Selecting Record In Parent Subform From Child Continuous Subform

Jan 26, 2014

I have two subforms on a main form. Both use similar queries and nearly the same set of records and PK. The first subform is for data entry and the 2nd subform is a continuous form that lists the entries in order that are made from the 1st Subform. (for entering in vacation days and appointments)

The continuous form cannot be edited, it is to be a list for viewing the information only.

I have an edit button next to each record on the continuous form. When the button is clicked, I want it to take the 1st subform to that specific record as well (same PK), so the information can be edited there.

I cannot figure out how to get the 1st subform to go to the record on the continuous form when the button next to that record is clicked on the continuous form.

I tried the DoCmdSearch for record and just keep getting object is not open errors.

View 2 Replies View Related

Forms :: Check / Uncheck Checkbox On Parent Form If Records Exist Or Not In Subform

Jul 23, 2015

I have a parent form which has a yes/no checkbox in the form's record source. Then in that parent form I have a sub-form. If NO records exist in the sub-form I want the checkbox to be UN checked. If records DO exist in the sub-form, I want the checkbox to be CHECKED.

But I want this to happen as records are added or deleted from the sub-form. In other words, if the parent form is opened and no records exist in the subform then the checkbox should be unchecked. But as soon as the first record has been entered in the subform, the checkbox on the parent form should be checked. Likewise, as soon as the last record has been revoved from the sub-form, the checkbox on the parent form should be unchecked.

What code do I need to accomplish all of this?

View 1 Replies View Related

General :: Find Record From Field In Subform And Then Return Its Parent Record

Feb 6, 2014

I have a database which has a main form and subform built in linked by parent/child customerid, what i would like to do is search all the subform records from the whole DB and return its parent record on the main form?

Can this be done? because if i use find it will only search the filtered form i have onload of the form?

My onload event is based on fosusername()

View 3 Replies View Related

Cancel Record In Subform If Click Cancel On Parent Form Before Save

May 24, 2014

I have a form and a subform in it. I added New cancel button in the form so that the the user can cancel the record creation and no record will be inserted in the parent table.

But when details are entered in the subform (a datasheet) row records will be created in the subform table. what is the correct method or how to cancel these records if the user choose to click cancel button on the parent form.

View 5 Replies View Related

Delete Parent Record But Not All Children

Aug 11, 2005

Well, my newbie status in db development has reared its head. I knew from the beginning I didn't want to have cascade delete when deleting a clinic (parent) from the db. Problem is some queries in other areas need some clinic info and if the clinic is deleted, it won't be available. Right now I'm thinking that an easy way out is only allowing a delete if it has no attached records. If the clinic is no longer used, they can just write in the memo field that this clinic is no longer used. It's not a large db and there won't be hundreds of clinics so it may not be too bad. Any other suggestions?

scratch

View 6 Replies View Related

Disable Subform When Creating Record In Parent

Jul 27, 2004

I'm having difficulty controlling data entry to (disabling) a subform when a new record is being added to the parent form. I can set the subform to be disabled if there is no index value in the parent form (this allows the subform to function for existing records) but then the user has to create the parent record and move off of that record and then return to it in order to add child records to the subform. This is basically a create new records/data entry problem and I'm feeling pretty stupid. There must be a way to handle this...

View 3 Replies View Related

Queries :: Parent Child Query - Sum Images In Main Record

Oct 15, 2014

I'm trying to create a capacity report for my database. Originally, I only had the one table, which summed the number of Packs and number of Images, worked out percentage capacity used and then put it in a report, showing for each week of the year. However since then, I've added a child table to this, allowing me to create subrecords. The reason we did this was so we could easily group together multiple mailings under one single master record, so to speak.

Going back to the capacity, I've managed to work it so the Pack capacity is worked out from the mailing quantity in the subrecord. However, the number of Images is only entered onto the Parent record. Now my capacity query is summing the same number of images as there are subrecords, where in reality I only want it to sum the Images in the main record. I know I could add an Images field to the child table and work it out the same way, but I'd rather not do that (because that's not how our business works).

So essentially the question is, how can I sum the Images from the parent table without repeating the sum and massively overexagerating the sum?

View 6 Replies View Related

Forms :: Subform Control Event - Identify Parent And Child Forms

Jun 20, 2013

I have a listbox on a subform (or a subform within a subform).

When it is clicked I want all other listboxes to unselect.

There may be listboxes on the mainform, on other subforms, on other subforms of subforms.

I imagine I'm looking at a recursive function of some sort, but I'm not entirely sure of syntax to identify parent and children forms...

pseudocode so far:
loop all controls
if control = listbox, unselect all
if control = subform - recurse: loop all subform controls
if control = parent... err... Fail.

View 3 Replies View Related

Forms :: Query Criteria Used For Same Subform In Multiple Parent Forms

Apr 11, 2014

I have a sub form that shows me a companies history. This subform is used on 2 different Parent forms. The record source for the sub form uses a criteria that looks at a companyID field on the parent to determine which records to return. My question is how do I have the query criteria depend on which form is currently opened? The criteria would look something like this:

[Forms]![frmCompanyHistory]![txtCompanyID] OR [Forms]![frmCompany_Project_Details]![txtCompanyID]

If I open the form with this criteria, I will be asked for a value in txtcompanyID for whatever parent form is not open. How do I properly do this without making multiple queries that are almost identical?

View 5 Replies View Related

Forms :: Parent And Children In A Transaction

May 3, 2014

I have a parent record and child records. After creating the parent, there must be at least one child record.

On closing the form I could, in principle, delete the parent and child (or children), if the user changed his mind.

Or, I could presumably wrap this entire enterprise in a transaction, something along the lines referred to here: [URL] ....

View 1 Replies View Related

Parent & Sub Form Mix UP

Nov 3, 2006

I have a parent form and a subform linked to the parent.

My client decided that he wants one of the controls from the parent form to be placed in the subForm area. The source of the control is still in the parent table but he just wants to place it in the subForm.

I am having a hell of a time doing this......

I tried to do it by changing the recordsource of the subForm by joining the Parent and Child tables so I could have access to that field in the subform.

But this is very ineffecient and I am getting new errors coming up as a result.

Any ideas ????

Thank you

View 5 Replies View Related

Forms :: Pre-populating A Subform With Parent Data

Jun 2, 2015

I have a parent and sub form in dataset view.

What I would like to do is prepopulate the subform with data from the parent form when I create a new item of data..

i.e.
When I click the "+" button Field1 on my subform is populated by Field1 on the parent.

I have tried beforeupdate on both the subform properties and the subform.Field1 properties.

View 3 Replies View Related

Parent Form Vanishes When I Tab To Option Group In The Child Form?!

Apr 7, 2006

I have a rather annoying and frustrating problem which I cannot find a solution for through searching the forum.

The situation is that I have a parent form with 1 unbound subform, the source of which is determined by the part number selected in the parent form (diffetrent parts have different fields of the source table displayed)

This all functions perfectly well in all but one case which is when the source of the subform is a form with an option group.

There is only 1 form like this, and the problem I have is that when tabbing through the fields, as soon as I tab into the option group the parent form disappears, and I am left with just the subform on screen! Clicking into the group is fine, just tabbing to it causes the problem, and if I remove the option group then tabbing through all the rest of the fields is fine...

I could powssibly change the option group for a set of option buttons and code them to function a bit like an option group, but this would mean changing the code for numerous reports etc. and I don't really want to do that if I can help it.

View 2 Replies View Related

Getting Data From A Parent Form

Apr 10, 2006

I have been having alot of trouble with this and just can't figure it out, I am trying to get data from a parent form into a subform so I can use it in equations. Specifically I have a DOB (Date of Birth) field on the main form, and want to have a =DateDiff("yyyy",[DOB],Date()) to find their age.

I need this in the subform because of some other information that relys on it. The way I have it right now you have to manualy put the DOB in the subform, and it can be different from the value in the main form. Could any of you tell me what I am doing wrong here?

View 4 Replies View Related







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