Populating Subform #2 Field With Subform #1 Field

Jun 1, 2006

I have a mainform. I select from a couple of combo boxes. Based upon these selections, it pulls up appropriate info in subform #1.

There is a field in subform #1 which I want to populate a field in subform #2 with (automatically).

What kind of "event" is this? After/before? I tried everything, nothing works.

Let's try these naming conventions:

Main form = mainform
Subform #1 = subform1
Subform #2 = subform 2
Field Subform #1 = fieldsubform1
Field Subform #2 = fieldsubform2

Help me write the code and help me locate where to put that code. It's been troubling me for a long time.

Thanks, I hope someone can help me out.

View Replies


ADVERTISEMENT

Forms :: Populate Subform Field When Open With A Subform Field

Sep 4, 2014

I have a form called frm002_PAF_MonitoringMAIN and on this form I have a subform called frm002_PAF_Monitoring. The subform has a button to another form for contact details called Contact_Details. The Contact_Details form opens with the details of the person who I have selected on frm002_PAF_Monitoring. There are some fields on frm002_PAF_Monitoring that I would like to be populated on Contact_Details when opened, like FirstName and LastName. How can I do it?I have tried on afterupdate event on Contact_Details below but those don't work:

Me!FirstName=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me!FirstName=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]

View 11 Replies View Related

Filtering Field In 2nd Subform Based On Selection In 1st Subform

Sep 1, 2006

I almost have this form done.

I have a form with a combo box, and 2 subforms from it. When you select in the combo box (Group), it brings up the choices (Sections) for that group in a subform. Then there is another subform, that is supposed to bring up a series of questions that are related to the section that has been selected. The question field has a drop down to a list table, that has all the questions. Once the question has been selected, it stores in a Master table. The relationship is there. If you try to select any questions that do not pertain to the section, it gives you an error message.

What I need it to do, is when the section is selected, filter out the questions that pertain to that section, and have those questions be the only ones available in the drop-down list to choose.

I know that I need to have an After Update code once the section has been selected, but not sure how the coding should be.

I hope that someone can help with this!

:confused:

View 1 Replies View Related

Filtering Field In 2nd Subform Based On Selection In 1st Subform

Sep 1, 2006

I have a form that is almost complete

I have a form with a combo box, and 2 subforms from it. When you select in the combo box (Group), it brings up the choices (Sections) for that group in a subform. Then there is another subform, that is supposed to bring up a series of questions that are related to the section that has been selected. The question field has a drop down to a list table, that has all the questions. Once the question has been selected, it stores in a Master table. The relationship is there. If you try to select any questions that do not pertain to the section, it gives you an error message.

What I need it to do, is when the section is selected, filter out the questions that pertain to that section, and have those questions be the only ones available in the drop-down list to choose.

I know that I need to have an After Update code once the section has been selected, but not sure how the coding should be.

I hope that someone can help with this!

View 1 Replies View Related

Forms :: Copy Value From Field In Subform To Field In Main Form During Data Entry

Jul 18, 2013

How can I get the value from a field in one table (in the sub form) to copy/insert into a field in another table (in the main form) when adding a new record?The main form and sub form are linked using parent/child linking, and the sub form is in a tab.I have table A (Visit Dates) in the main form which is used to record the date of a visit to a church. Table B (Quarters and Peals) is used to record an event that took place at that church during that visit. Note that not all visits in table A require a record to be created in table B - but half or more do.

In tables A and B I have a field called "QuarterOrPealID" and these are both primary keys, though the field in table B is set to 'no duplicates' and in table A it's set to 'duplicates allowed', as table A has its own auto number/pk. They are both linked in the relationships.

So, when I add a new record to table A using the main form, I might then need to click on the tab in the sub form to create a new record in table B, which has to be linked to the same record in table A. When the "QuarterOrPealID" auto number/pk is generated in the sub form (table B), I need that value to update to the "QuarterOrPealID" field of the main form (table A), so that when I'm viewing these records the form pulls all the information nicely together.

View 10 Replies View Related

Modules & VBA :: Filter Subform Data - Only Show Records Where Field A Is Higher Value Than Field B

Oct 24, 2013

I want to filter my subform data, to only show records where field A is a higher value than field B.

Code:
Me.MySubform.Form.Filter = "A > B"
Me.MySubform.Form.FilterOn = True

This way it doesn't find field B.

Code:
Me.MySubform.Form.Filter = "A > " & MySubform.Form!B
Me.MySubform.Form.FilterOn = True

This way it seems to filter all record to the field B value of the first record.

View 5 Replies View Related

Forms :: Move Focus From Last Field Of Subform To Another Field On Main Form

Aug 19, 2015

I am currently stuck on set focus property. I have a main from with nested subform. I am trying to move the focus from last field of the subform to another field on the main form.

Customers(mfrm)....>Addresses(sfrm)...>Orders(sfrm Add)......>OrdDetails(sfrmOrders)

Now I have a field name [Securedesign] in frmOrderdetails and I want the tab order to navigate to field [CustomerID] in frmAddresses which is a subform to frmCustomers.

View 2 Replies View Related

General :: Update Main Form Field Value After Updating Field Value In SubForm?

Feb 12, 2015

I have a main form and a subform.

Both forms have the field called JobID in common.

Both forms have a field called JobStatus.

Any easiest solution so that After I Update the field called JobStatus in the subform, it changes the field called JobStatus in the main form to the value which was selected from the subform?.

View 3 Replies View Related

Lock A Field On Main Form If A Field On A Subform Is Complete?

Oct 24, 2005

hi, i would like to be able to prevent a user from being able to change a field (lock a field) in a main form if a field in a subform is complete. (the field in the subform is named: "new_weekly_base" if this is complete then i would like the field: "weekly base" to be locked on the main form. is this possible?, please help.

the main form is named: "SCREEN-MAIN"
the subform is named: "SCREEN-SUBFORM"
(the main form has a button on it which loads the subform.)

ive tried the below code but it doesnt work, any help would be excellent.

-------------------------------------------------------
Private Sub Form_BeforeUpdate(Cancel As Integer)
If [NEW_WEEKLY_BASE] >= 0 Then

With Me.WEEKLY_BASE
.Visible = True
.Enabled = False
End With
End If
End Sub
------------------------------------------------

View 4 Replies View Related

Rowsource Of Lookup Field Dependent On Field Value In Same Record In Subform

Jul 6, 2014

I want to create a different rowsource-query for a lookup field (field1) in each record in a subform. The rowsource changes dependent on the value in another field (field2) in the same record. How can this be done?

- I tried to change the rowsource-query in an eventmacro when the focus is set to field1, but this ofcourse changes the rowsource for all field1's and makes the allready selected values unvisible.
- I think I have to include the value of record 'field2' in the rowsource query, but i cannot find a way to include that value in the query.

Something like:

Lookup field1 in the subform contains this rowsource
- SELECT CUSTOMER.Id, CUSTOMER.AGE, CUSTOMER.NAME
FROM CUSTOMERS
WHERE (CUSTOMER.AGE= me![field2]);
me![field2] however does not function

View 5 Replies View Related

Forms :: Data From One Field To Fill In Field In Subform

Nov 26, 2013

I am doing this all as a bound form

My main form got a field named 'PersonID'.

My subform also got a field called 'PersonID'

The subform 'PersonID' populates however the mainform 'PersonID' does not.

I just need to write code, or maybe do something that will copy the number from subform and paste it in the mainform field, maybe at the click of my save button.

View 8 Replies View Related

Set Value From One Field On Main Form To Field On Subform

Nov 2, 2012

I need to choose a value, which will be a number from one field (TaxRate) and have it update a field on my subform which also is a number (TaxRate)

TaxRate set subform TaxRate to value chosen

main form is named AddProducts and subform is named AddProductsSubform

View 14 Replies View Related

Modules & VBA :: Sum Of Field Of A Field In 2 Different Subform

Jul 20, 2015

I am trying to create a simple budget planner. So far, I have the following table:

tbl_account [id|acc_type|acc_name|balance|memo]
tbl_expense [id|exp_date|exp_amt|exp_acct|exp_payee|exp_type]
tbl_expense_cat [id|cat_name|cat_type]
tbl_income [id|inc_date|inc_amt|inc_acct|inc_payee|inc_type]
tbl_income_cat [id|cat_name|cat_type]

The relation now are:

[tbl_account:id] ---> [tbl_income:exp_acct] --> [tbl_income:id]
|_______> [tbl_expense:inc_acct] --> [tbl_income:id]

I have 3 subform on the main form:
[account_sf]
[expense_sf]
[income_sf]

I have set all them to continuous. Now I have added 3 account in the tbl_account.

I wonder how to SUM all the income of certain account, and minus all expense of certain account, and have them showed in the subform tbl_account.

Here is the attach pics: Untitled.jpg

View 6 Replies View Related

Dyanamically Populating SubForm

Apr 28, 2005

I have a form (Form1) with subform (SForm1) embedded in it. Now my Form1 is based on query (query with search criteria) which is dynamically linked (with VBA code). I want to populate SForm1 dynamically with records based on one field (customerID) of Form1.
I am able to populate Form1 with search query, however, the SForm1(subform) is not populated. The SForm1 is based on query with criteria which is supplied by (customerID) in the Form1.
Any help is appreciated.
Thankx in advance.
Prodigy.

View 8 Replies View Related

Forms :: Pre-populating A Subform

Apr 21, 2015

I have a Form1 and Sub Form2...Form1 is a list of tasks: Each task has a quantity of Items.The forms are in Datasheet format.I have a list of people who can only do specific tasks and at present my Form2 is able to only select the relevant people for that task.The only way to "Trigger" who can do which task is to populate what quantity of work I want them to do. ie. create a link.

Is there anyway of clicking the little + button on Form1 that it prepopulates the total quantity to Form2 therefore creating a link and therefore being able to select who can do that task.If you look at the pic I want Items in the dropdown box to pre populate with the same amout as in the Form1 Items ie "1"

View 1 Replies View Related

Tables :: Auto Populating A Field Based On Selection Of Other Field

Jun 27, 2014

I (will have) a form which a user fills in to enter new data.

I have two fields,

"Branch" and "Branch ID" (Branch ID will not be on the form, just in the table)

Branch will be fed by a combo box with seven choices. I would like it so that when "Branch" is populated it autopopulates Branch ID with a code which relates to the branch, so for example

BRANCH BRANCH ID
Braintree BRA
Colchester COL

View 4 Replies View Related

Forms :: Access Subform Not Populating

Jan 1, 2014

A subform on a main form is not populating after the user clicks on the subform and then returns to the main form and updates the field which the subform is linked to. The first time the subform populates absolutely okay; however once the user clicks on the subform and then returns to the mainform and updates the field which the subform is linked to the subform goes blank.

View 7 Replies View Related

Forms :: Populating Fields In A Subform?

Mar 3, 2014

I have database as follows,

1- student table: stID (PK), firstName, lastName

2-course table: courseID (PK), courseName, courseDescription

3- studentCourse: stID(FK),courseID (FK)

Now, I have created a main form based on student table and a subform based on studentCourse table. However, because I needed to populate the courseName and CourseDescription in the subform I changed its record source to a query (stID, courseID, courseName, courseDescription) so that when I move between the subform records the courseName and courseDescription still show in the subform.

To populate the courseName and courseDescription in the subform I changed the courseID to a combobox so that it brings the courseName and courseDescription from the course table and show it in the subform.

Everything is working fine so far BUT when I choose to input a courseID manually into the combobox, it does not populate the courseName and courseDescription as it does when I choose the courseID from the combobox.

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

Sum Of Subform Field

May 21, 2006

Hi,

Just to give you a bit of background to my database...
A job (project) can be created and purchase orders can be attached to it. The customer may pay for the job when the work has been carried out or pay in installments.

So each job can have a number of payments against it.

http://img.photobucket.com/albums/v368/flemmo/jobs.gif



Here is my form:

http://img.photobucket.com/albums/v368/flemmo/jobpayment.gif

I'm trying to get the 'Total Payments' box to add together all the payment amounts of the subform (datasheet) using =Sum([PaymentAmount]) but this comes back with #Error.

Anyone know how to do this?
Thanks.

View 1 Replies View Related

Forms :: Subform - Combo Box List Not Populating According To Main Control

Apr 17, 2014

I am using MS Access 2010, I have three tables,

Policies (Id, Client Id, Address, Policy Amount, Paid)
Payments (Id, Client Id, Total Amount)
Payment Details (Payment Id, Policy Id, Paid Amount)

I have created a form "PAYMENTS" that include a sub form "PAYMENT DETAILS".

In the sub form control Policy Id is defined as combo box, and retrieving the list from Policies and Payments where Policies.Client=Payments.Client the query of Combo Box is as follows:

Code:

SELECT POLICIES.[POLICY ID]
FROM POLICIES
WHERE (((POLICIES.PAID)=False) AND ((POLICIES.CLIENT)=[Forms]![PAYMENTS]![ClientId]));

Only first time Combo Box display the Policy Ids according to the Client, but when I change the client and always displays the previous clients Policy Ids.

how to retrieve correct list of Policy Ids according to the Input Client in Payments.Client control

View 4 Replies View Related

Reference A Field On A Subform

Feb 26, 2005

I have 10 fields on a subform. they are named value1 to value10 consecutively. I would like to loop thru them, and get their values to use in subsequent events. I tried the following to reference them...

Dim iLoop as integer
Dim fldVal as control
Dim ItemValue as string

For iLoop = 1 to 10
fldVal = ("Forms![Form 1]![Subform 1]!value" & iLoop)
ItemValue = fldVal
Next iLoop

I also tried a couple of other variations, but cannot get this **** thing to work. Any help would be appreciated.

View 2 Replies View Related

The Value Of A Field From A Subform Of Another Form?

Jun 22, 2006

I'm trying to link a form to open when a field is double clicked on the main form. When the form is opened it should open to the current record that is present on the subform.

In the opening form, I tried using a parameter query as the record source that references the current ID field on the subform. I think my problem is with referencing the value in the subform from the form that I am opening. I've read the FAQ for referencing to help me and so far this is what I've got as a parameter in the query for referencing is [Forms]![frmMainEntry].[Forms]![fsubWOArchive]![TrackingID]

The subform control on the main form is fctlWOArchive
The subform itself is fsubWOArchive

How do I get the value of the TrackingID field from a subform of another form?

Thanks,
PC

View 5 Replies View Related

How To Update A Field In A Subform?

Jul 19, 2006

Hi!
I have Form1 with two subforms in. They are both on subform1 level (not nested).

From one of the subforms i can ask the parentform for a value in a textbox on parentform: Me.Parent!Controlname.Value

But:

How can i succeed updating a subforms textbox (called "textbox1"), when being on main (parent) form?

I have tried with this syntax: Me!Subform1.Form.textbox1.Value = "test"
Neither does: Me!Subform2.Form.textbox1.Value = "test" work..

Thanks for your help ;) I've spent hours with this one..

View 2 Replies View Related

Subform Field Setfocus

Apr 8, 2005

When I open the “FrmStudentEnrollment” form in the attached db and enter a license number in the License number field (this field is inside a subform) that is not in the db, the “FrmStudentInfo” form opens allowing student information to be entered. After entering student information in the “FrmStudentInfo” form I have a close command button to return to the “FrmStudentEnrollment” form.


This is where I need help! I would like, when returning to the “FrmStudentEnrollment” form for the focus to be on the “AttentDate1” field located in the subform “FrmStudentInfo”. I used the LicenseNo Combo Box NotInList VB from Northwind db but there seems to be problems here too.

View 1 Replies View Related

Forms :: Get A Field Of Subform

Mar 29, 2014

I have a Main Form. Then I have a SubForm that have other two subforms and a button.These button open a new Form.I need a field of the SubForm in the new Form.I try with these, but doesn't works. I thing I try all the possibilities but nothing:

Code:
Me.Id_Episodio = Forms!Paciente!Subform1.Episodio_Sub!Id_Episodio

View 3 Replies View Related







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