Remove last row in a locked subform - ms-access

I am pretty new to access so sorry that this is a low level question. I have a form with a couple subforms on it and one of the subforms is locked for editing. That subform is just used to see values associated with a field in the main form. The problem is, in that subform it shows the last row (where you usually add info for a new row) as filled in for a couple fields and blank in others. I assume this is a product of it being locked. Is there a way not to show the Last part where you enter new information since I'm not going to be adding info there anyways? Thanks in advance for any help!

Change propery Allow Additions on Data tab of subform to No

Related

MS Access - Form tries to create new record on open and record jumps about a continuous form

So I have two issues with my database, which I think are linked together.
Firstly if tblDeliveries is empty and frmMainView is opened it comes up with "You must enter a value in the 'tblDeliveries.deliverySlot' field" but the form shouldn't be trying to create a record and I can't see any reason why it would. Opening frmDailyView (which is a subform of frmMainView) doesn't show this behaviour but it is the one with the continuous form on...
Secondly if tblDeliveries has one (or more) rows the first row of the table will jump about... For example in frmMainView if the date of the first record is set to 23/01/2015 and you navigate to the 24/01/2015 and click anywhere on the subform and then press F5 to refresh the record will have jumped to that date, the date even changes in tblDeliveries.
I have no idea why it's doing it, I even removed all of the VBA code for the form to stop it, but it happens anyway.
If anyone has come across anything like this before, please let me know how you fixed it, or any suggestions would be very welcome. Thanks!
EDIT: If you download the database, add your computer login name to tblUsers. Also the date is UK formatted, so might need tweaking to work with US dates.
The offending database (1.5MB)
Taking a look at your database, several issues are occurring.
You first issue can be resolved by going into the Design View of the table tblDeliveries, select the deliverySlot field and change Required (in bottom panel) from Yes to No.
Your second issue is multi-faceted with many issues but a critical problem is that the parent-child link field, deliveryDate, between the main form and subform is missing in the recordsource of the sub form and the field's table origin is not in the query's join statements. For me, I can't even update anything in subform (all boxes are grayed out).
Essentially, you are trying to normalize Delivery Dates and Delivery Times (one-to-many) but the left join query (qryDeliveryIncBlanks) setup is not aligned to this effect. You user login also does not integrate smoothly into frmMainView. My ultimate advice is revamp your database design relational model then use forms as the visual representation of those related tables.
I am not re-iterating the points of #Parfait.
Access Forms have a property DataEntry. If it is set to Yes (or True in VBA), then the form will open itself pointing to a new empty data record. Set this property to No (False in VBA).
If you want to give the user the possibility to manually enter a new record, set the property AllowAdditions to Yes and to No otherwise. Yes displays an empty record marked with a star * and the end of the data sheet or continuous form.
I've resolved the issue, thanks to some of the comments I realised I could just give the deliverySlot field a default value with a number outside of the range it would look for, I set it to 99, but it only looks for 1-20. The date still jumps around but since it's not in the range of the query it's hidden. It's resolved both issues.

How Do I Make a Subform Controlled by Report (Which is Controlled by a Query) Update After Records Are Added?

I recently took a duty position that requires me to track our administrative actions. Previously, the office had tracked them on an Excel spreadsheet, and the historical data was corrupted/missing. So I have built a database in Access 2010. I designed the database to display a main form that provides an overview of each action, but decided to require most of the data to be added or updated on specific data entry forms. My question relates to two subforms on the main form that I cannot get to update after data is entered into the tables. Here are specifics:
1) The main form is the case detail form, and each case has a unique case ID number that links most of the forms and tables.
2) The Case Detail Form has two subforms. One displays the names of the people involved in the case (this is the Subject Subform). The other displays the case history entries (this is the Case History Subform).
3) Both of the subforms are supposed to work the same way. Each is populated by a report which displays the information in its corresponding Subform. In turn, the reports underlying each Subform are based on a query that selects the records to display based in the case number.
4) New data for the subforms cannot be entered on the Case Details Form. Instead, the user can press a command button which launches a separate form that allows the user to enter either subject details or to enter a case history update. Once the user enters the data, he or she clicks A Save Record button, which saves the record and closes the form window. Everything seems to work fine up to this point.
5) However, I've now been working on this project for two weeks (as time permits), and I am still not able to make the two subforms update automatically. If it's a new case record, the user can make the Subforms update by using the navigation arrows to leave the main Case Details Form and then returning to it. If it's an established case record, a refresh button that I have added to the main Case Details form will cause the two subforms to update.
As I've tried to make this work, I've tried a number of approaches that I've found on various boards. Right now, I have:
A) The Subject data entry form has a Me.Requery statement in After Insert Event Procedure
B) The Subject data entry form has a SaveRecord and a CloseWindow command that are executed when the Save Record Button On Click event is triggered.
C) The main Case Detail Form has a executes a Me.Case_Subjects.Form.Requery when the GotFocus Event Procedure is executed.
I apologize for the lengthy question and explanation. I'm an Army officer and a little out of my depth with this. I would greatly appreciate any help anyone might be able to offer.
Best regards!
I'm not sure having understood everything but I try to give you some suggestions about what to try.
If I'm not wrong both form and subforms have the case ID as field so when you created the report you should have put them in "link" by the wizard (you can set it manually after but it's a bit more tricky).
Did you do this? This makes the form / subforms update when you navigate them.
Please note that there must be a relation between the underlaying tables to guarantee that the reports / forms moves together!
This applies to the query too, just remember to include the ID field int the queries.
If you don't want to see the ID (in case you use an autonumbering id) you can set it Not Visible.
In case you don't want to link the two tables with a relation there is another solution but it's a bit more tricky and, if it's not your case, I don't want to make confusion.
Let me know if you solved.
Bye
Firstly, the line Me.Requery should be on the After Update event, not the After Insert event. Secondly, you will then need to change Me.Requery to Me.[insertsubformname].Requery.
As the user above said, you will need to ensure that you have created your database relationships properly, however if you used the Insert Subform, it should've asked you what you wish to use as your link between the forms.

Associating new records in a subform with record in parent form

I am working on a purchasing database in MS Access 2010 for a non-profit, and have encountered a problem that I can't seem to solve using other resources.
I have two tables relevant to this discussion, one of purchase orders, and one of line items. Each line item record has a purchase order number (which is actually a text field, as letters are allowed) associated, with 'enforce referential integrity' turned on, one PO to many purchase lines.) In order to edit PO's, I have a form, which I originally created with the wizard, but have modified heavily since then. In the PO editing form is a subform, which displays a datasheet view of the purchase lines table, filtered by the PO that is current in the main form.
Initially, when I created a new record in the subform, it automatically set the linking PO field to the current PO. This way, new purchase line records were assosciated with the current PO. Recently though, the new records are being created with no value in the linking field, and unless I manually select the PO in that column, the record gets filtered out of the view when it is saved.
So the question is, what property controls how new records are initialized in a subform of this type? Is there another problem that is likely to cause this behavior?
Unfortunately I didn't notice this problem right away, so I don't know what changes came in between it working and failing. Furthermore, it seems to be intermittent, working some days and not others (but never changing within one day.) I assume that this just means I'm missing another variable.
Some things that I have tried, based on my research before asking here:
Previously, the 'Link Master Fields' property of the subform was set to the 'ID' field of the parent form. I have now created a text box in the main form that is linked to that field and set it as the master field. To be honest, I don't understand how that would help, but multiple how-to-guides recommended it.
Making the linking field required in the purchase lines table. This prevents the record from disappearing, but doesn't change the initialization.
enforcing referential integrity between the two fields. As I said, it is now enforced, but originally it wasn't. This didn't cause any noticeable change.
Manually saving the record before entering the subform. Similarly saving the subform record before I exit it.
Thanks you kindly for any advice.
I know this post is older, but I just recently ran into this issue and found a solution.
I imagine your database is split. Problems stem when your Access version is greater than the version your database was built in.
Delete the tables from your front end and then relink to them. Reset your forms Master/Child fields and everything should work as normal.
Hope this helps somebody else in the future.
On the subform, make sure both the Link Child Fields and Link Master Fields properties are set to the database fields that the relationship was created on. If the parent form is bound to a record source that includes the key field that the relationship was created on, you shouldn't need to specify a text box or any other control to link on, just the name of the field.

Access continuous forms and comboboxes

I have a continuous form with three comboboxes on it. Each one's recordsource is filtered based on the value in the preceding combobox. I am having a problem with the 2nd and subsequent records not referencing the values in their current record... they appear to be referencing the first records value. I have attached a picture to better illustrate the issue. My question is, how can I get the comboboxes on the 2nd and subsequent records to reference the value in their current record?
Thanks in advance guys!
Looks like there are some limitations in Access I can't get around with just implementing it right outta the box.
Custom row source for combo box in continuous form in Access
However, I refresh the form when evver I click on Control 2 or 3, it will refresh the rowsource for that control to use the value in the current record's Control1. That seems to be working!

How to lock specific rows in a subform when a form loads?

I have a subform containing records with a Yes/No field displayed as a checkbox on the subform. When the main form is loaded, I need to lock all checked fields so that the user cannot undo what a previous user did: they should only be able to check/uncheck the boxes that were unchecked at the start of thier session.
Is it possible to iterate through all the records in a subform and lock the records selectively based on the field value when a form is loaded?
I know I can put something like
If (Me.chkItemReceived.Value = -1) Then
Me.chkItemReceived.Locked = True
Else
Me.chkItemReceived.Locked = False
End If
in the subform OnCurrent event but this prevents the user from unchecking a box they may have checked accidently. I can iterate through the records on the subform but can't figure out how to lock the records at row-level.
My other solution is to split the form into two subforms of course - items checked vs. items not but would rather keep it to the one form.
Thanks for your help!
No, there is no way to have specific rows (or records) locked in the GUI in MS Access. If you change the properties of a control on one record, it changes it on all records in the subform.
I don't think you could even get away with doing row-level locking directly on the underlying table. Typically, locking is done to prevent others from editing your records. But in this case, you are trying to prevent yourself from editing them.
The two methods you describe (OnCurrent and separate SubForms) are probably your best options. For cleanliness of the code, I'd choose the latter.
Well, you basically gave yourself the solution to your problem - if I am reading your question right. You can set it so when you iterate to the next record, certain controls are locked from editing based on the value of those or other controls. You are not actually locking the rows in the tables, of course, but you are preventing the user from changing the value of the locked controls.
If you mean to prevent other users from editing the record you just edited - then this would not solve your issue.