Split form columns not displaying correct value - ms-access

I have a split form set up in Access 2007. In it, I have one combo box to select a school, and the After Update event for this combo box populates a second combo box.
The second combo box selects an item of equipment, and the query associated with it selects all equipment located at the selected school, unioned with the currently selected piece of equipment. (If the school selection changed, the box would turn blank, but actually still hold a value, so I unioned it with it's own current value)
Anyhow, the issue is that the equipment column in the split view only shows equipment values that are associated with the currently selected school as well. For example, if I have a form with schoolA and EquipmentA selected, only equipment also associated with SchoolA will appear in the Equipment column of the split form data sheet. If I change the School column to SchoolB, any rows that were populated with equipment associated with schoolA disappear, and equipment on rows associated with schoolB now show up.
Interestingly, if you click on the school column of the data sheet, this also will update the equipment column to only show equipment related to whatever school was in that row.
To summarize: changing the value of one field in my split form will change what data is displayed in the data sheet portion of the form. Clicking on the fields column in the data sheet has the same effect.

I had the same issue, as you describe. I used a workaround (i.e. used different control instead of split-form)
My Situation:since In the split-form, I was just showing the records, and not allowing users to edit the records in split form. Users could click on any record in split form, which would show in main form, and then could edit. The main purpose of this form was for the users to be able to search for the data in split form and then select and edit.
My workaround : Created a form, where I used text boxes to search, and a list view to show all the columns which were in the split form. On double click event, I added Open the form filtered with the record which was double clicked.

Related

Issue w/ Cascading Combo Boxes deleting field values from records they pull from for Form

My apologies if this question has been answered before but I've searched all day today and haven't been able to find the answer I seek. I'm building a database for requesters to submit requests to order paint using combo boxes that pull from a PaintCatalog table, broken down by ProductName, ProductColor, Nomenclature, UI, StockNumber, DuplFieldCd (I use this a unique key for paints with the same product name but come in multiple colors and Units of Issue.) I've been trying to set up a form to pull the data into cascading combo boxes from this PaintCatalog, with each selection reducing the dropdown choices until it reaches only 1 choice, at which point it autofills specific fields. Then the user clicks a command button and the values in the form fields are used to create a new record in the PaintRequests table. I've got most of that to work, however when I delete values from form's combo box fields when I'm retesting the form, one of the records in the PaintCatalog starts to get blank values. I need this issue fixed before I can progress any further. I've tried using a query instead of referencing the table directly, but the data is still getting edit, deleted, or overwritten. I'm getting that pencil icon every time I'm using one of the form combo box fields. Please advise.

How to get combo box selection to fill related fields with data

I have a table [inventory] with inventory items, and a bunch of columns with different information for those. Mainly, part#, description, price. I am trying to create both a purchase order form [POForm] and, and a inventory transactions form [TransactionsForm], but that one thing I've been stuck on is getting a combo box look up I use to select the part# from [inventory], to also fill my fields for description, and price for that item in my form. I need the fields that are filled to be able to have formula's run off of them, and the information to be saved into the table for that form [TransactionsTable], [POTable].
I've tried making my part# combo box include the fields for the description and price, and using =[part#].[column](x) in the other fields as a lookup, and it looks right visually, but that is apparently just a visual of that data, but technically the field is still blank, because those other fields remain empty in the table for that form, and I am not able to run a formula off the price.
As per my understanding and please correct me if I am wrong. you have a form that shows your inventory data Part# Description & price. This form has a combo box that allows you to select a particular part # to view its related record data description and price.
Now you want to click a command button after selecting a particular part # to update your transaction form and POtable.
1.you have to create a query,
2.insert the inventory table in it
3.select append from the query type in the ms access ribbon
4.a window will appear, choose the transaction table as the destination table to append to.
5.double click on the fields that you want to retrieve its data from the inventory table
6.then in the table below in the query itself in the "append to" row you will find drop-down menu including all the fields from the transaction table. choose the corresponding fields. note if the fields have the same name in both tables access will do it automatically.
7.in the criteria row type the following [Forms]![Inventory Form Name]![the name of the field in the form]. do that for each field in the happen query.
8.save the query and name it
9.go-to design view in your inventory form and create a command button, in the click on event creat macro of the following: openquery-->type the append query name
10.save and close macro builder
11.open your form, select part#, click on the button
12.access will ask you to confirm appending process. click ok/yes
13.check your transaction table to confirm that the append process was successfully performed
14.Tip if you do not want the confirmation msg of append to appear, in the click on event go to the macro builder and choose in the ribbon show all actions then in the first line of the macro builder insert setwarnings - NO
the same is to be applied for the POtable.
Anyways, I hope you find this clear and helpful but I have only one concern you do not have to append part description and price in transaction and PO tables as you already have this data in your database in the inventory table. Generally speaking no need to include the same information in multiple tables otherwise you are not benefitting from the idea of a relational database.
I hope I addressed your inquiry.

How to display all data in field (combobox) on form when rowsource of combo box does not include this value

Data previously entered into field not displayed when field on form is a combobox control
Have a form that displays information about an event. It includes the name of the staff member who initially set it up. The Combo box rowsource for this control is a list of current staff members only. If the original staff member who set up event has left (ie not current) the control shows a blank when form is opened on that record.
I want to know how to display historical (ie any/all data) but if user wants to change anything they only get the current (ie updated) list available to them.
The control stores the staff ID, the combo box displays the staff name (linked from the staff table. So when try to change the options it says I can't as the bound column is hidden.
You don’t have a lot of great choices here.
You of course cannot delete such records since as you point out, such history data will thus break.
There are a few suggestions I can think of.
First up, add the “active” staff column to the combo box display. Then if a user changes or chooses from the combo box, you can prevent (or warn) that they are selecting a non existing staff member. This would display non active staff, but would in theory allow users to select in-active staff – you might not want this. (but you could warn, or prevent in the control before update if you want to prevent this).
Another way is to dynamic load the combo box based on the current record. In other words, if the form is in say “add mode”, or the combo box is blank, then you load up the combo box with a select statement that only includes StaffActive = True.
The above can work rather well if you limit your “main” form to one record (I tend to do this). I tend to present a search form and THEN always launch the main form to ONE record.
So in the forms on-load event, you could check if the column id of the staff is set, and if not active, then you load up the combo box with all staff.
If the column has a staff memember that is active, then in the form on-load, you set the sql of the combo box to only active members.
This approach is “tricky” if you allow record navigation. In that case, you have to put the testing in the on-current event, and set the sql of the combo box that way. Hopefully the staff list table is “small”.
The 3rd way to fill a combo box is by using call backs. This is a LITTLE known approach, and again with on-current event, you could test for the id being a non active and thus set a vatriable (likely global) that allows the call back code to include non active staff.
However, if you stored “id” in that column of a staff record that no longer exists, then there is not a lot you can do. (I would perhaps attempt to re-enter the deleted staff with the correct id’s).
So it not clear if the staff record is deleted, or you have some “active” flag. If you have an active flag, then you can “test” if the staff “id” from the combo box is a non active staff, and then shove the correct sql into the combo box data source that includes the non active staff.
I suppose for performance reasons, and some reduced “flicker”, then I would perhaps set/track what the current combo box is displaying, and ONLY update the combo box if the status (non active) members are required.

Updating multiple (linked) datasheets on the same subform

I have a navigation form with multiple tabs. Under one of the tabs, I have inserted several datasheets. These datasheets are all related to the same table – they simply display different fields from that table. The reason that I use multiple datasheets linked to the same table is that the table contains many fields, and I don’t want to force my users to enter data into a single “wide” datasheet. An ID column is also present in each datasheet to help the user identify the same record across the datasheets.
When I enter a new record in one of the datasheets, I want that record to be displayed in the other datasheets as well. My problem is that a record entered in one of the datasheets will not instantly be visible in the other datasheets. I have to close the form and open it again, and only then is the record displayed in all of the datasheets.
I tried to solve the problem by inserting a requery statement in the After Update event of the datasheet, but this makes no difference. Any ideas?

MS Access unbound textbox in tabular form - Student attendance

I am creating a DBMS for a school and in implementing student attendance, I have encountered an issue. I have a query that pulls the names of the students enrolled into classes and created a subform to contain that information. This subform has two additional fields (unbound text box and a combo box) that users will enter information to which will be updated into the attendance table using an append query.
It is with these unbound text boxes I am having problems.
Basically, when data is entered into these text boxes it updates for every record instead of just the single record.
As you can see from the picture above, adding late and 10 mins in the first line adds the same value to all records.
More screenshots below, please let me know if any additional information is required.