Forms :: Values Populated From A Subform To A Main Form Not Saving To Table?

Feb 4, 2015

I am having a problem with calculated fields that are populated on the main form from the subform not saving to the table the main form is linked to.

I created a Purchase Order table that has information on what emplyee created the record, reason for order, customer information if its ordered for a customer, creation date, eta date and notes while the Purchase Order details table is for information on the supplier, product item number, product name, quantity and cost. they are linked by the Purchase Order number which is the primary key in the Purchase order table. it all looked good so i made the form with the Purchase Order Detail as the subform, i got the form all working great and how i wanted it but then i decided i wanted the supplier name and the subtotal of the cost in the main form populated or calculated by the values in the subform.

I copied the fields i wanted populated in the main form to the subform footer and added the calculation for the subtotal then added the formula to the source code on those fields in the main form so the values would populate. it all worked great on the form and the values populated as they were supposed to so i saved the record and went to look at the tables and i found that while the values in the calculated fields that I populated from the subform showed up in the form they didnt save to the table while the non calculated fields saved fine. i did some experimenting and found that if i delete the code and put the data source back to the table in the form and just type something in the text box it would save to the table but not if i had the code in and let it populate.

an example of one of the codes i used to populate the data in the main form is:

=[frmNewPurchaseOrderDetails subform2].[Form]![txtsubfrmSupplierID]

did i mess up in the code or did i do something to the relationship between the form and the table?

View Replies


ADVERTISEMENT

Forms :: Subform To Get Values From Main Form Into Master Table

Jul 15, 2013

I have a form, a subform and a master unique table. I need the unique table to updated in the following manner: Form has certain fields that need to be assigned to every record created in the subform[id] and [info1] Subform has a unique [caseid], and contains further [info2] but needs to be bound into [id] in the main form. Example of the master unique table:

id info1 caseid info2
1 aaa 1001 asd
1 aaa 1002 dfg
2 bbb 1003 fff
3 ccc 1004 ffg
3 ccc 1005 ggh

I've managed to accomplish this with a linked table&subform structure, but the master unique table looks like crap because it collapses the subform values into sub-records in the master table when the [id] is similar. The data is in the rigth place, i just want it not to be collapsed/expanded, but every unique recors shows in the table in the regular format

View 8 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 :: Requerying Values In A Subform After Updating Combo Box In Main Form

Apr 21, 2015

Within my main form I have a combo box called "workgroup." Also in the main form is a subform called "sfrmSubmissionRecords," and within this subform is a combo box called "covermemo."

Each cover memo is assigned to a specific workgroup, so my intention is for each time a new workgroup is selected from the dropdown, the covermemo combo box in the subform becomes populated only with the covermemos associated with that workgroup. I'm almost finished except for the final step when I try to make the values regenerate...Access says that can't find the referenced form "sfrmSubmissionRecords"

This is the code that I'm using:

Private Sub cmbWorkgroup_AfterUpdate()
Forms![sfrmSubmissionRecords]![cmbCovermemo].Requery
End Sub

View 2 Replies View Related

Forms :: Continuous Subform Based On Same Table As Main Form

Jul 4, 2013

i'm creating a database which holds all animals. i'm trying to make the parents selectable in a subform based on the same table as the main form - this doesn't work for whatever reason ("table is already opened exclusively by another user,..."). it can't just be one field or a query, it needs to be a subform because besides name and eartag i also want to display a small picture of the parent and only the filename is being stored.

i'd really like it to be selectable records in a continuous subform, so the risk of selecting a wrong id is minimized. is there a way around this not being able to use the same table for a subform?

View 14 Replies View Related

Forms :: Adding Multiple Records To A Table Using Main Form And Not A Subform

Sep 12, 2013

I have an existing Main form that has a sub form that the user uses to enter multiple records into a table....it works fine EXCEPT that I need to make it even easier and more intuitive and add a lot of labels. Basically the user selects items from a drop down list that adds items to a Work Order. I need to add some labels to the form to make it more descriptive for the user.

So, what I want to add multiple records using a single main form.

Is is possible to?:

1. simply turn the subform into a single main form? Can this be done by using a Command button or something similar?

2. copy all of the controls etc from the sub form into a new main form and have it all work nicely?

View 2 Replies View Related

Exit A Half Populated Form Without Saving Record

Feb 27, 2006

Hi could someone point me in the right direction for this one,

I have a series of linked tabbed Forms. One of the Forms is mostly populated by Combo boxes which all work fine. My problem occurs when you go to add a new record and populate the form with the combo boxes but decide for some reason not to save the record but exit the form using the Close form command button or by using the close button at the top of the Form. Access seems to Save the record anyway. I have placed an Undo Cmd on the form to clear all text boxes which works fine but it does not stop a user from closing or exiting a Form by another means and stop them saving that incomplete record.

I would be grateful for any thoughts on how to solve this problem.

Thanks in advance

View 4 Replies View Related

Set Values In Subform When Opening Main Form

Apr 16, 2007

Hello,
I'd like to know how to set values to a subform when opening a main form
I have a quotation form called FQuotation with a subform on it.
This subform is the link between the products and quotation it is called SFProdQuote and has the fields: refproduct, quantity, quote and PQTotal.
Once I have filled the info on the main form i pick the products on the subform using a combo box on the refproduct field, input the quantity and give it a quote.
All this works fine it calculates quantity x quote = total.

My issue is I'd like to create a quotation form that opens with a set of products already selected in the subform. let say 10 of them, since my quotations always start with the same 10 products or so. I do not want the users to have to select over and over the same things.

Is it possible to open a form with set values selected in the combox of its subform?

Thanks for your help

View 1 Replies View Related

How To Disable Subform Untill Values Selected In Main Form?

Jun 29, 2005

Hi every body . I got a a form and sub form. I want to disable sub form untill the user finishes selecting values from combo box drop downboxes. I be happy if some one show me how to do this.


http://i5.photobucket.com/albums/y180/method007/disablesubform.jpg

(form picture)

View 3 Replies View Related

Query To Return Default Set Of Values In A Subform When Main Form Opens

Apr 23, 2007

Here is my sample DBA

I'd like to solve this issue

when I open my Quotations form I'd like a set of services to be selected by default, ex: Brush and Pen. So the user only has to input the quote amount

is there anyway to have the form open with a script like:
"on open (or on load). in subform SELECT refproduct where product from tblproducts = 1 and also SELECT refproduct where product from tblproducts = 4"
Therefore when my main form opens, in the subform I have already Brush on the 1st line selected and pen on the 2nd. My user only has to type the price.

Thanks for your much appreciated help

View 2 Replies View Related

Sort Subform Records On Numeric Values Stored In A Text Field On Main Form

Sep 25, 2015

I have developed a database but have had difficulty with sorting data within subform of a main form. The subform displays the related tasks that correspond with main form that has been selected. Within the main form I have also created a text field that defines a particular sorting sequence of the tasks found within the subform which is titled Task Sequence. What I would like to do, is use the Task Sequence field to sort the order of tasks within subform. I have tried: IIf([ID] Is Null, 0, Val([Task Sequence])) within the Advanced filter/sort but either it shows only the first task defined in the Task Sequence or it wants to filter the main form and not the subform.

View 14 Replies View Related

Forms :: Subform Not Saving Data Into Table

Nov 5, 2014

I have a subform which is for payment, it has a calculated field which is called TotalPayment, with expression:

=Nz([Forms]![Reservations2]![Days]*[Forms]![Reservations2]![Rate],0);

in the control source. When a value is displayed in this field an ID number should be assigned to the PaymentID field, but this does not happen, the field remains null.

View 1 Replies View Related

Forms :: Continuous Subform - Validate Data Before Saving To Table

May 18, 2013

I have a continuous subform that displays lots of questions. This specific form has 10 questions on it. Each question has one answer and the users are required to select one answer for each question. I am trying to do some data validation before the data gets saved to my table to ensure that users have answered all the questions. I found some very useful code online and tweaked it to suit my needs. The validation works perfectly on subforms with only one question, as I have some other tabs that use it.

On the specific form that has the issue, the validation works as expected when no question has been answered, but when a user answers only one question and leaves the remaining nine questions blank, the validation does not work. I guess it is as a result of the continuous form repeating the different questions and ms access thinking that the data entered for one question alone is complete when it actually isn't.

Code:
Private Sub Ctl4_frm_Staff_Exit(Cancel As Integer)
Dim ctrl As Control, EmptyStr$
For Each ctrl In Form_subFrm_staffQuestion.Controls
If InStr(1, ctrl.Tag, "Required") > 0 Then
If IsNull(ctrl.Value) Or ctrl.Value = vbNullString Or Len(ctrl.Value) = 0 Then

[Code] ......

View 1 Replies View Related

Forms :: ComboBox Populated By Query Not Showing Values

May 9, 2013

I have a form for data entry that have multiple comboboxes. I am trying to get one combobox to base its "list" on an entry from a previous combobox. The first combobox is based on a QuantityType table and has four options.

The next combobox is based on a ProductDesign table and will have close to fifty options. I want to limit the ProductDesign combobox based on the QuantityType selection which will give the QuantityTypeID. This will refer to the QuantityTypeID linked to the ProductDesign table.I have created a query that looks like this:

SELECT Product_Design.Product
FROM Product_Design, Quantity_Type
WHERE Product_Design.QuantityTypeID = Quantity_Type.QuantityTypeID
AND Quantity_Type.QuantityType = [Forms]![Product]![Qty_Type];

This Query works and if I simply run the query I get the needed information from it.What I would like to do with this query is to populate the ProductDesign combobox with this data.I have tried putting the query in the RowSource field but I get an empty combobox without the data. The strange this is that the combobox must be getting something from the query because the length of the combo box varies based on my QuantityType selection. I.E. if I select "Single" in the QuantityType, the ProductDesign dropdown shows three empty places for data whereas if I select "Multiple" in the QuantityType I see that there is ten empty places for data.getting the combo box to actually show each option?

View 1 Replies View Related

Saving Main & Sub Forms

Feb 15, 2005

Hello,

I have an Orders form (frmOrders) which has a subform (frmOrderDetails) detailing the individual order items. For example, there is one order which may consist of many items.

The problem I have experienced is that if someone completes frmOrderDetails first and then moves to frmOrders the records are not saved correctly. I know this is because the main form frmOrders has not been saved or had a field completed which would produce an OrderID which can be linked to frmOrderDetails.

Whilst I could say to users they must complete a certain field first, some will forget and I would like to protect against this.

Whilst the tab order will go to a field on frmOrders, is there a way of forcing users to complete this field before they enter frmOrderDetails.

Alternatively, is there a way of coding a command button to initiatve an OrderID.

Or do you have any other suggestionsm

Thank you.

View 3 Replies View Related

Forms :: Subform Datasheet To Populate Main Table

May 19, 2014

I have a subform that is essentially a blank table which users can create rows depending on how many they require and fill the table in.

I then want to be able to append a main table with the records that have just been created in the subform's table... but here is where an issue lies.

Main Table has 6 columns... subform table has 5.

I already have the value to put into the 6th column but Im just not sure how to do it... the value is obtained from the original form.

For each record, copy that record into the main table + adding another value into the extra column.

Is this possible? or doable?

View 4 Replies View Related

Forms :: How To Get Main Form With Subform

Sep 27, 2013

i have a main form for customers and a subform for sites which is set to locked so its displayed as just a list. I have a button on my main form to add a new site for the current customer displayed..How can i get the Main form '1CustomerDetails' with subform '2SiteList' to automatically refresh one i've clicked the save button on another form.

View 1 Replies View Related

Forms :: Subform Does Not Associate With Main Form

Mar 15, 2013

I have this form that contains subforms to hold different types of infomation for different clients. At the top of the form it has the case #, first name, last name, and then a tab element in which each of 6 pages (tabs) holds subforms for other information associated with the client.

I have a table that holds only client number and name.Then each of the six subforms operate off of a table, and all the tables are connected through relationships using client number, first name, and last name.

How could I make the subforms autofill their cooresponding tables using the case #, and name fields from the main form without having to repeatedly input the client #, names for each tab/subform?

View 4 Replies View Related

Forms :: Connecting Main Form To A Subform?

Apr 21, 2015

I have a form that shows information on a person (think first name and last name) at the top and contains tab controls that hold subforms each containing a different set of info about that particular person. Ex: for person 1 the main form will display the persons first and last name as well as show the subject tabs. as you click on each tab you should see the information that pertains to that person. I would like to step through each ppeson one at a time using the horizontal record arrows (eventually I will change this process to using forward and back buttons) on the main form with the persons names changing as well as the information in the subforms changing to match the person on the main form. I can step through each separately (main form and each subform) but I cant get the subforms to change information when the main form changes persons. Seems simple enough but I cant get the subform to change when the main form changes. They are not connected. This is for an Access class that I am taking and we use Access 2013.

View 2 Replies View Related

Forms :: Filter Subform From Main Form

Jun 27, 2013

All using 2010. I need to filter a subform from the main form.

Code:
sfrmMedCInfo.Form.Filter = "[SSNum]= '" & cboSSN & "'"
sfrmMedCInfo.Form.FilterOn = True

It's throwing an error: Variable not defined pointing to sfmMedCInfo. why do I need to declare the subform and how?

View 3 Replies View Related

Forms :: Using Total From A Subform In A Sum In Main Form

Jul 8, 2013

I am trying to create a time sheet that enables my workers to fill out separate work orders and the hours from those Work orders are auto transferred to a sub form within their daily time sheet. I have gotten all this done and I have the total hours transferring to the main form but I need to use that transferred number in a new sum on the main form. I know that this cannot be easily done just by using the expression builder.

View 10 Replies View Related

Forms :: DSum On Main Form From Subform

Aug 11, 2015

I have a subform from which I want to calculate values into a text box on the main form, to keep a running total of weeks for individuals. Using the expression builder to just add the fields, I only get the total for the current sub-form record. If another record is added to the subform, the total reverts to zero, and then it takes that record's input as the total. Which makes logical sense.

I think I need to do a 'DSum' from the subform/table, but I'm not sure how to sum for just the current ID/individual. I have tried to bodge it myself with the expression builder, but it tells me that 'the function contains the wrong number of arguments'.

View 6 Replies View Related

Forms :: Move Subform To Behind Main Form

Apr 13, 2013

I have a form with a subform in it. The subform is actually going to actually have more information and is going to take up the majority of the form. The reason why it's the subform instead of the main form is because of the nature of the parent/child relationship.

Layout-wise I'd like to have the content of the main form in the top left, with the subform taking up the space from the top right down to the bottom. This ends up covering the content of the main form in the top left. I tried using the Send to Back function on the subform but it still blocks the main form.If there's no easy way then I guess I'll just have to have the entirety of the subform below the main form content.

View 2 Replies View Related

Forms :: Store A Value From Subform In Main Form

Sep 19, 2014

I'm getting a #name? error in my text box in the footer (doesn't matter where this is placed on main form. I've changed this to be forms. and forms! but no difference in the outcome.I just want it to view the total figure from a purchase order subform. This is populating correctly but isn't being stored anywhere, just shows.Also, any way I could make this invisible when the form is in form mode?

View 3 Replies View Related

Forms :: Referencing A Subform From Main Form

Jun 24, 2015

I have a form and subform with the following names:

frmBasic
sfrmCustomers

I have a unbound txt field called txtCustName on the mainform
I want to populate this field from a field on the subform called CustName when the record is selected.

I also have an unbound combo box with the cust ids using the row source from the tables record source from the main form.

I tried the following Code:

Private Sub cboCustNum_AfterUpdate()
Me.Filter = "[Cust_ID]=" & cboCustNum
Me.FilterOn = True

Me.txtCustName = Forms.frmBasic.sfrmCustomers.Form.CustName
End Sub

This didn't work. So I put "= [Forms].[frmBasic].[sfrmCustomers].Form.[CustName]" in the control source of the text box on the main form I want populated.

The name doesn't appear in the field. I get #Name? in the field.

View 4 Replies View Related

Subform Is Populated Based On Form Data?

Mar 22, 2006

** Additional Note: Could I possibly just have a field in my main form that pulls data from another table? Warning: bad with code**

I'm not sure I'm looking at this correctly and have tried to figure it out (For about two weeks now). I really hope someone can help with this.

I have to add a "Multiplier" to my form. I have tried this numerous ways but it's not working properly.

What I need is to have a main form with a subform only displaying the relevant field (that being if this month/year and location match up between both the subform table and the main form that is displayed, then show this value in the subform on the main form). With this multiplier displayed, another field in the main form is then multiplied by this value.

Is this the right way to do this or no? I'm open to basically anything. It's just that the 'multiplier' changes from month to month and rather then have people manually enter in the multiplier to the main form for every day of the month, I'd rather a field be automatically populated and therefore the other field automatically multiplying by this.

Is this possible??

View 1 Replies View Related







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