Forms :: Subform Not Saving Automatically
Dec 23, 2013
I have one problem with subforms. I have one bound main form and two bound subforms: one subform is used to display existing records in datasheet view while another is used to enter new records in form view, but this latter subform for new records will not save automatically, nor will it save by using the me.refresh or me.dirty=true in the unload event of the subform control. The parent child relationship is intact. I can even see the primary key of the new row in the subform but it does not appear in the table that the subform is based on. This primary key adds by one automatically.
I have struggled and finally made work a combo box in the main form that finds existing records but also is able to add new records when the value entered is not on the list. Below is the code I used. I am not sure if this code is overriding Access's save ability of the subform?
Private Sub Combo316_AfterUpdate()
Dim n As String
gblvariable = cbobox
Me.Requery
n = DLookup("ID", "[Customers Extended]", "[Customer Name] = '" & Me!Combo316 & "'")
[Code] .....
View Replies
ADVERTISEMENT
Feb 11, 2014
I am having trouble figuring out the method to automatically update some fields in SubForm from 2 other SubForms.I have attached 2 pics, the first GradeEntry1 shows what the tblTopic_Class_Grade form looks like after I manually enter everything into it. GradeEntry2 is what the form looks like when I fill out the Form starting at the top.
I'd like the tblTopics_Class_Grade form auto-populate the TrainingClassID (it currently does this), TopicClassID, StudentID, TrainingTopicID based off the entry from the above forms.My end goal is that I need to have a grade for each student on each training topic for each class. Like:
Class1-Student1-Topic1-GradeX
Class1-Student1-Topic2-GradeX
Class1-Student2-Topic1-GradeX
Class1-Student2-Topic1-GradeX
View 6 Replies
View Related
Dec 3, 2013
I have a subform and I want to save the username to the bound table in this subform.
I've tried creating a textbox (CompBy) and then setting the default value to = Environ("UserName") but this doesn't work.
I've tried placing the following in the afterupdate event of the subform:
Me.CompBy = Environ("username")
DoCmd.Save
But this doesn't work either.
View 1 Replies
View Related
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
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
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 3 Replies
View Related
Jul 7, 2006
Hi,
I was wondering if there was a way for a report to be automatically saved as an excel file. Also, the Access database is stored on the company's server so would you be able to choose the path where the excel file would be stored?
Cheers,
Ben
View 1 Replies
View Related
Nov 6, 2013
I have created an MS Access 2007 for a user. When the user uses the database, it automatically saves a copy of the database. Why is this happening? I did create for the database to compact/repair each time to user closes the database. ... However, when I open/close the database, there are not new copies of the database.
View 1 Replies
View Related
Jul 30, 2013
I have a main form and subform. The main form is bound to a table of invoices and the subform to a table of invoice items. I'm picking up the invoice number from the form to save it to the invoice items table, so I need to save the record for the invoice before saving the invoice items from the subform.
View 4 Replies
View Related
Jan 17, 2014
I have a subform with records of call details (date, time, subject) - the date and time are autogenerated and subject is a text field. After entering text in the subject field and then clicking on the close button in the main form, or clicking anywhere else in the main form, the record is saved to the table. However, if I enter text in the subject field and then move up to view previous records (within the subform) and then click the close button in the main form the record is not saved in the table. How can I either save the record before allowing the user to move to another record within the subform or before exiting the subform set the focus to the new record so that it will be saved on exit?
View 4 Replies
View Related
Sep 14, 2005
I have a subform within a form and the subform has the child records for the main form. When I move from the main form to the subform by tabbing the records in the main form are saved. However, in the subform after it is completed if a certain field in a groupbox is chosed another form opens up which contains records in the many side of the relationship with the first subform. The problem is that the first subforms records aren't saved because the originall form isn't closed and I don't want it closed...How would I save those subform records when the new form opens up?
Thanks,
View 3 Replies
View Related
Jun 29, 2006
And another question...
In my database I have a button on a form which leads to a subform popping up. On the subform popping up, I display data from the first form. However, unless I first save the original form and then go to the subform, the data isn't passed on. How can I make the button both open up the subform and save the form so that the data is passed on?
Again, any help is much appreciated.
View 1 Replies
View Related
Jul 17, 2013
find the attached MS access DB for INVOICE printing . I am facing two issues there .
1. {form INVOICE } sub-total must be Calculated from line total on {INVOICE DATA Subform} , I know this can be accomplished by adding a new field at sub-form and calling that value to main form's sub-total field .
2. And the real issue is i want to save this value from subtotal on form INVOICE to table field name subtotal .
3.I wish to make a reporting format for each INVOICE NUMBER , whenever report is being generated , the report shows more than 1 invoice details .
View 2 Replies
View Related
Jul 18, 2013
Access 2010. one of the forms i load into a navigation form is in datasheet view and some vba re-sizes all the columns as it loads in.
However, this then means that when i try to navigate away to another form i always get prompted whether to save the form or not.
because the form is in a navigation subform i can't use:
Code:
DoCmd.Save acForm, Form_NavigationForm.NavigationSubform.Form.Name
' or this...
DoCmd.Save acForm, "my_form"
in both cases i get an error : the object my_form isn't open
View 1 Replies
View Related
Oct 25, 2013
For some reason when I change the order around of the columns in a split form or subform 90% of the time it wont save (right click save, file save, etc..) and have to constantly redo it until it finally works. Am I missing something obvious as to why this is happening?
View 3 Replies
View Related
Apr 11, 2006
I have searched, but found no reference to my exact question. I have a list of drivers I need to create a checklist for each day. The Parent form is the day and the subform is the list of drivers. What I would like to do is have a command button automatically enter all the drivers that are active (denoted by a chechbox) into the tabular subform.
View 14 Replies
View Related
Aug 12, 2007
Hello
there is a field in my form named "numphotos" and I write the number of photos than that folder contains.
I have a subform in that main form named "descriptions", here I describe, one for one, all photos of that folder.
Itsnīt a problem if the folder contains a few photos, but I have folders that have even 100 photos :confused: then I must to create 100 records in my subform :eek:
I would like than Access create those records automatically according to the number of photos that I indicate at the field numphotos.
My example in photo: http://farm2.static.flickr.com/1141/1093088982_a084bff95f_o.jpg
I only would desire that Access create that many lines to me as I have written on "numphotos". I would write the rest of the information (photographer and description)
is it possible?
thanx!!
windowsXP
access 2007
View 5 Replies
View Related
Oct 22, 2006
This may be a simple question, but I'm not sure what to even search for. I have a form with multiple subforms. All the subforms have related fields that are linked via relationships. But one subform has no fields in common with the parent form.
I need to be able to have the subform update itself whenever the record is changed on the parent form. I can't figure out which event procedure to use. It updates correctly if I assign my procedure to the form_click sub, and then click each time I want it updated, but that's a pain. I've tried on load, on data change, on activate, on data set change, and a couple others, but nothing works automatically.
How can I make the subform run a subroutine each time the parent form changes records?
View 4 Replies
View Related
Dec 10, 2004
i have a form frmCreditNote with a subform sfrmCreditNote. They are linked by a creditNoteNumber.
As soon as i pick a customer in the main form, i want the first line of the subform to have that customer name as well.
If I change the customer name in the main form, I need the first line of the subform to correspondingly change as well.
If the form was new, i would open a recordset and use .AddNew to put in the new first line date
If I was updating the form customer name, then I would need a .Edit to change the first line of the subform.
My question is : how do I determine if the subform is empty? Is it a command likeIf subform.HasData, orIf IsNull(?)Please let me know thanks
View 1 Replies
View Related
Oct 10, 2006
Hello,
I have a main form which has 2 subforms. The main form is the name of the Student. The first subform is the data entry form. It has 2 fields. One for the Trimester - a drop down which has "1, 2, 3" listed. And the second field is the benchmarks (again drop down). Now the second subform is a more elaborate way of viewing (only for viewing purposes) which standards have been chosen for which trimester. Now this form's control source is a Crossstab query, which updates the Trimester field for each of the benchmarks for the particular student.
Now my problem is I am trying to update this subform which is for viewing purposes only, automatically, so that the moment a benchmark is chosen on the other subform, the [trimester] field automatcially gets updated on this form. All the benchmarks are listed on this form (view form) and a field which is the trimester field. Data entry is not allowed in this form. So the information has to get updated automatically. It does when I close and open the form, but thats not how it should work.
I tried everything I thought possible (requery, refresh, a button to click) but couldn't get the form to update.
Please help! I would really appreciate if you could help me find a solution.
Thanks in advance
A
View 1 Replies
View Related
Oct 31, 2014
All I have a form called frmMain. This form contains a TabControl named tabMain tabMain has some pages. One of the pages is called pagRecords pagRecords contains a subform called frmRecords. frmRecords contains records from an in-memory table.
My problem: If I select tab pagRecords the cursor is set to the last record.
What I want: as soon I select tab pagRecords, the record cursor must always be set to the first record.
I think this can be done with next code.
Code:
DoCmd.GoToRecord acActiveDataObject, , acFirst
However, I placed this line in a lot of event properties but it is never triggered (I put a break on the line).
So on which object and event should I put this line? (and is acActiveDataObject the right parameter?)
View 2 Replies
View Related
Apr 13, 2015
I Have a main form called table one has 3 fields an autonumber as primary key and i have a subform called table 2 has 3 fields one an autonumber a primary key , second is an integer which is equal to table 1 primary key, and third is a text with default value set to N/A
i want when the user enter info in the main form and save it, the subform automatially add new record and save it with default settings..so far what s happening , that the related field in the subform to the main, is getting change but record is not getting save in the table 2
View 4 Replies
View Related
May 4, 2014
I have a mainform with a combobox and a button. What i want is when i click on the combobox and then on the button I want that the textbox in the subform automatically fill in.
The mainform name is FrmTakenInvoerenEnToewijzenAanEenMonteur,
The combobox name is Keuzelijst1,
The subform name is SubTakenInvoeren,
And the textbox name is txtOpdrachtnr.
I tried this code in on button click:
Me.SubTakenInvoeren.txtOpdrachtnr = Me.Keuzelijst1
But that doesn't work.
View 7 Replies
View Related
Mar 18, 2015
I have a form and a subform
Which method should I use if I need to update automaticaly a field in form based on an event in subform ?
Just to be more clear, have a look in the below example.
In first print screen, student "Johnson Nick" has not completed all tests in TestA subform, the form field "DateCompleteA" is blanc.
Once a student completes all tests in Period A, I need the form field DateCompleteA to show the date that he completed the last one. (18/3/2015).
If student has not yet completed all tests in TestA subform the Form field DateCompleteA must be blanc.
Student has not completed "literature"yet, DateCompletA field is blanc
Student completed ALL his test, subform is updated, Form field DateCompletA is updated with the maximum date.
View 3 Replies
View Related
Jul 14, 2015
I have had some issues caused by users exiting the database entirely when they realise that they have entered something incorrectly; this in turn has caused problems re-opening the half finished record (the last step of the record creation is to allocate it a unique reference number, which is then used to re-open the record for editing on a point and click form) - now, this is entirely my fault for expecting users to clear up behind them or to exit properly.
So, I am making some changes - when the dashboard form opens it removes the database window close button. I have a separate close button which has the following code:
Code:
Private Sub cmdGoodbye_Click()
Do While Forms.Count > 0
DoCmd.CLOSE acForm, Forms(0).Name, acSaveNo
Loop
DoCmd.Quit
End Sub
However, I would like to add a line to automatically save any records before closing each form - is this possible?
View 7 Replies
View Related
Feb 24, 2005
I have created Several Forms but I am not able to save any new records in them.
When I click the add new button the records are added alright. but when I exit the form and reopen it all the new data added to the form is lost.
I even tried the save button but that doesnt help.
anyone has ideas what happening here..
Regards
Rahul
View 2 Replies
View Related