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 Replies
ADVERTISEMENT
Aug 21, 2013
I have a subform embedded in a main form, the subform has a field (text box) that is doing automatic calculation so no manual entries are needed from the user. I have tried to pass automatically the final result to a text box in the main form, but all events are not working (afterupdate, On change, On Dirty), etc.
I have a button to do the above mentioned in the main form, but I don’t want to use that button, I want to do all the process from the subform.
Also, from the subform I was able to do click on the button on the main form (programmatically), however MS Access is too quick and the value extracted from the subform is always empty (zero); Acees is finishing before the calculation is done.
I am using MS Access 2010.
View 4 Replies
View Related
Sep 19, 2012
I have a mainform set to data entry to add records to TABLE1. I inserted a subform that shows fields from TABLE2. I have a field in TABLE2, let's say TBL2FLD1(NUMBER). I want to add TBL1FLD2(NUMBER) from TABLE1 in the mainform to TBL2FLD1 and update said field in TABLE2.
My problem is:
(1) I get a #TYPE! error when I try to add the two fields, which I have tried many, many ways (adding them together in the Default Value; creating an unbound field to hold the calculation and then putting that field into the Default Value of TBL2FLD1; ETC), and
(2) I don't know how to get the subform to update TABLE2. It seems like the control gets stuck in the subform. Is there a way to accomplish this without coding it?
View 3 Replies
View Related
Feb 22, 2013
I believe I did this before awhile ago but for some reason I keep getting an error.
I have a Mainform (frmMain) that has a Subform (frmSub). On frmSub I have 2 comboxes (strCom1 & strCom2) one is set to invisible (strCom2.Visible = No).
So using the "On Open Event" of frmMain I want make strCom2 visible if strCom1 = "Read Only". Ofcourse I will also need to place the vba on the On After Update event. Below is what I have so far but doesnt work.
I get Run-time Error 2427 "You enetered an experssion that has no value"
Code:
Private Sub Form_Open(Cancel As Integer)
If Me!frmSub.Form!strCom1.Value = "Read Only" Then
Me!frmSub.Form!strCom2.Visible = True
Else
Me!frmSub.Form!strCom2.Visible = False
End If
End Sub
View 5 Replies
View Related
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
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
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
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
Dec 1, 2007
I have a main form with a field "Calibration Date" which shows the latest calibration date of a specific item. I have a subform that has a field "Cal Date" that is the latest calibration of this specific Item. In the Subform there may be multipul "Cal Date" enteries for that specific item but in the main form I want the "Calibration Date" to update to the newests Cal Date enetered into the subform.
View 5 Replies
View Related
Jan 5, 2012
Seems like nothing I have so many questions today.
I have a main form and a sub form. The main form have a command button where when I clicked, the Sub form text fields should be empty or cleared.
How do I refer to that of subform from the main form?
This is what I have now and its not working.
Code:
Me.Forms![frmAuditAddNewMain]![frmAuditAM].Form!Text123 = ""
View 3 Replies
View Related
Dec 1, 2005
I have a subform which makes a change to a field on the main form. When focus is returned to the main form, the BeforeUpdate and AfterUpdate events fire. Why? I thought from the form's perspective, the subform is just another control.
BTW, I get the same behavior if I modify the field from within the Exit event of the subform control.
In either case, the main form's Dirty event is NOT triggered.
View 2 Replies
View Related
Feb 13, 2015
I have a music database. It's somewhat over the top in terms of the information stored in it, but I like it. My issue is with getting the total number of tracks, as well as the total duration, for a given album (and for each disc, but if I can solve one that should also solve the other).
I have a lot of tables and forms, but for this problem I only need to deal with two of each. They are the tables for albums, the table for tracks, and their associated forms.
In my album table I have information such as album title, artist, release date, and album length. The tracks table contains information on each song - track title, track number, parent album, and track length.
My main form is for the album itself, and contains a subform for the tracks on said album. They correspond to the relevant tables.
What I want to do is obtain the value of the album length by calculating the sum of the track lengths for that album, and the number of tracks. Easy enough - Sum(TrackLength) and Count(TrackID) respectively, both of which can be stored in the footer of the subform.
My problem is that, rather than simply copying those values into text boxes on the main form, I want to copy them into actual fields in the album table. Furthermore, I want them to update as I add or edit the track lengths in the subform.
View 4 Replies
View Related
Aug 16, 2013
I have an entry form with a field(combo box) called cboGetCode. I also have a sub form (continuous form) with number of fields, also an entry form. Now, I have added a code behind the cboGetCode AfterUpdate event to populate the result to relevant fields in the main form.
PHP Code:
Me.lngSCode = DLookup("[lngSchoolCode]", "[qrReadingFirstSchools]", "[lngSchoolCode]='" & Me.cboGetCode & "'")
This is working very well.Now, what I would like to do is get code as shown in the cboGetCode field to my sub form lngSCode field.
View 1 Replies
View Related
Apr 5, 2013
I have a query in my subform:
Code:
SELECT ContainsTracks.albums, ContainsTracks.tracks
FROM ContainsTracks
WHERE ContainsTracks.albums LIKE [VALUE IN TEXTBOX1 FROM MAIN FORM]
As you can see in the brackets, I would like to use the value in textbox1 on my main form in this query (so I can select only the tracks from the album that is typed in textbox1, disregarding the others).
View 1 Replies
View Related
Feb 25, 2006
I have a main form that has some sub forms on it linked by master child on PK. When I select a new record on the sub forms I want to take a date value from the main form and populate the value into a field in the sub form. How do I do this as I cannot see a new record event on the sub form?
help would be much appreciated.
regards
Peter
View 7 Replies
View Related
Jul 20, 2015
I'm using Access 2007. I have a few problems:
1. I have a switchboard. I want to click a button, that opens a form with a dropdown list, when I make my selection, it opens a subform in add mode, but the linked field in the subform isn't empty, but filled with the mainform's field value that I selected?
OR
2. Is there a way for me to open a form in add mode, add data to it, click the add button (I will add an add button) that allows me to add again, but this time a particular field is not empty, but filled with selected info from previous selection?
Say for instance, I have 2 fields (both combo box fields), I click add, made selections for both fields, I click add again, but this time one of the fields stays constant like it's already been selected. It's filled with what was selected from before.
Either of those 2 - which ever is simpler.
View 4 Replies
View Related
Apr 30, 2013
I have a Main form with a sub form.The main form is a customer record (form view), and the sub form is all other customers (same fields) datasheet view.I have a navigation bar to filter (using different queries) the results in the sub form
same postcode
Same company (different location)
everyone except Main form customer
I cannot get a different filter (Query) to show only customers whose name begins with the same letter as the customer in the main form?I have been trying Like but think I am referencing it wrong, as it prompts me to enter a value rather than using the value in the field in the main form.This is what I have in the query (of the subform)
Customer ID: <>[Forms]![NewAllCustomerListF]![CustomerID]
Customer Name: Like "[Forms]![NewAllCustomerListF]![CustomerName]" & "*"
View 2 Replies
View Related
Mar 7, 2014
I have a form with subform (datasheet) .
On my subform i have one field which shows the
productId ( which is filtered from combo boxes on main form) .
productId contains two columns
1 bound column(id) ( hidden with width 0 )
2 column (desription) ( shown with width 2 )
Now after entering the data when i come back to the form again . It hides the data from the productId field on subform , because data in combo box (on main form) doesn't match. Although the row is showing up , only the text in field (productId) is hidden.
Now when i change data in combo box on main form to match the ProductId , then the productId field text shows again. after changing combo box it hides . What i need is the existing data should not hide when i change the combo box selection.
see pic 1 where product matches and pic 2 where not. please note i am using master child relationship on the form/subform.
View 14 Replies
View Related
Sep 1, 2013
In my database main form with subform. subform have query as recordsource.total of one of field in subform shown on main form. all is ok and show total correctly but when subform have no records then total field on main form shows #error. How to convert this value either into null string or zero(0).
View 2 Replies
View Related
Nov 4, 2005
Hi,
Mainform and Subform are linked on field "barcode".
Barcode is the primary key for the table that Mainform is based on.
When user is entering a new record, I have the BeforeUpdate event of Mainform.barcode set to check to see if the barcode already exists in the table, and if so, to give the user some meaningful error message.
Works fine, except that the subform still updates to match the invalid, previously-used barcode. I want the subform to stay blank until the user has entered valid data in MainForm.
How do I accomplish this?
Thanks for any ideas.
View 11 Replies
View Related
Dec 21, 2006
Hi, I have a problem I don't know how to solve it. I have a subform in datasheet view, linked to the main form. There is a running total on the main form based on a dsum on a field of the subform.
When I delete a row on the subform datasheet, the main form calculation is not automatically updated. I had to create a "update" button to do the refresh.
Is there a "on record delete" event available for a datasheet sub form?
Thank you for any help.
View 1 Replies
View Related
Jun 23, 2015
I have a navigation tab with 6 sections, of the 6, 5 of them are self-made split view with a form view on top and datasheet on bottom and upon adding records through a command button on form view I would like the datasheets to update.
On other forms it would (I believe) update to the bottom of the datasheet, now on the ones I've been banging my head against it either replaces the top record or doesn't show up unless I switch tabs and switch back. From my searches I assume this is in need of a requery...
View 14 Replies
View Related
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
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
Nov 30, 2005
I'm supporting some Access/VBA code which includes the following behavior:
When an update is made in a (linked) child form, the current date/time is written to a textbox on the main form via
Me.Parent!txtMod = Now
Likewise, the BeforeUpdate event of the main form updates the same field (and then does a bunch of form validity checks, possibly followed by a Save).
When we upgraded to Access 2003 from Access 2000, a problem erupted:
When the user returns to the main form (by clicking on any control outside the subform), the following message is issued: "This record has been changed by another user since you started editing it (etc.)..."
At this point the user must choose between "Save Record", "Copy to Clipboard" and "Drop Changes".
Conceptually, I see why this is happening (though I wonder why Access 2000 didn't flag it). The subform is the "other user". When the main form is returned to, it is "Dirty" (unsaved update), so the main form's BeforeUpdate event fires, and attempts to update the field again (Me.txtMod = Now). Since there is a pending change to the field, an error dialog pops up.
As a quick fix, I replaced the code in the subform with a flag ("Hey, I've been updated!"), which the main form checks on the Exit event of the subform control. But that seems a horrible solution. Surely there's a better way?
Notes:
1. It would be preferable to have the timestamp updated right away by the subform, though having it updated when the subform loses focus is better than nothing.
2. Since a subform is a control from the main form's perspective, I'm surprised that a change to that control doesn't render the main form "Dirty". I guess from a database standpoint it makes sense (the form's table isn't getting updated at all; just the subform's). But then, how does the main form know that the subform has been updated?
3. I tried catching the error via Form_Error. I can make the dialog not appear via "Response = acDataErrContinue", but unfortunately it defaults to dropping the changes (old and new), rather than saving the new.
View 14 Replies
View Related
Sep 2, 2005
hi
i have a main form, which has a subform (subform1)
subform1 has a further subfrom (subform2)
in the subform2, i have a value, which on a double click, i wish the main form critical value to refresh to
thereby the main form refreshes to the value of the subform 2 value
i cannot work out the code, you may have guessed from the description of the question, i am a bit of a novice.
could anybody assist, please
View 2 Replies
View Related