MS Access - How can I unlink text boxes in a form from their table? - mysql

I have a form that relates to different products and their feedback. The intention of the form is to add new feedback to Feedback table. Present on the form are fields that are currently linked to Products table. But I do not want to add anything to the Products table, the text fields are just there for reference.
However, when entering data into this form, I am returned with an error asking me to enter data into fields. These fields are controlled with a DLookup function. But I do not want to enter data with these fields anyway - they are just for reference.
How can I unlink these text boxes from their table, so that when entering data into this form, the discussed fields are disregarded?
Edit:
screenshot of form in design view
This is what my form looks like in design view. I would like the first seven rows to be for user reference only and to have no effect on the Products table. The final five rows and fields present in the Feedback table - I would like these to be added.

Related

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.

Adding a sub-form to a split form as both single form and datasheet

I have a database of support tickets that each represent a single support project. Any single support project may have any number of emails related to it. I have a form that connects the two, and I like how it currently works as a nested datasheet: the main form is the tickets, and you can expand any ticket to show the email items attached to it within the same grid space.
What I want to add is a text box below the datasheet (ala split form) that shows the body text of the email that is selected, instead of the second datasheet list of emails in the bottom half of the form pictured. I have tried binding a single unrelated textbox and creating the subform as a split form, neither of which worked.
Is it possible to add a reference in a split form to some fields of a second table or query in datasheet form, and others in single-form form? (and obviously: how?)
The table of Emails is a linked table to an outlook mailitem folder, which means it doesn't and can't have an ID field, whether primary or foreign. The relationship is determined by a reference to the PK of the Support Project records inserted into the mailitem's subject. Creating a query that extracts this ID currently results in Access complaining that the expression is too complex (as per this question), and creating a query that filters the linked table by looking for the ID in the Subject is what's being used in the above example (as in WHERE Subject LIKE "*Support Project [#]CS" & [ID] & " *")
To change status and priority you still use a data entry form. We are going to build a data entry form for a 1 to many relationship. to get the text box to behave as you want wrap it in a subform targeted at the emails table and put that new subform in the footer of your current data entry form. The email section of your main data entry form should already be targeted at the email table as well. So you have two subforms targeted at the emails table. Start with an appropriate table structure like:
My form ended up looking like this, everything works as you would expect:
Email Text Form, record source is still the emails table. put this form in the footer for the email form, default view single form.
Email form: record source is emails put this form in footer for tickets form default view continuous.
Tickets form. record source is tickets default view continuous.

Lookup tables in forms not displaying correctly in tables

So, I had lookup fields on my tables. I have recently learned that this is a bad idea. So, I'm trying to convert them to lookup fields in the forms that fill those tables.
The lookup list is drawn from another table with the individual values. On the table, I went into design view under the lookup tag and changed "combo box" to "text box." The fields that were previously lookup fields now display the "key" of the item that was displayed previously in the field.
The form still shows the correct lookup value but the associated table no longer does it instead shows the number associated with the value and not the value. What do I need to do to fix this.
I guess my question boils down to not knowing how to link a lookup field in a form to a text field in a table.
You don't need to change your forms, just update your tables - change lookup from combobox to text box, you did this correctly.
Existing forms should work as usual, with comboboxes, settings for those comboboxes were copied from table settings and not liked to table settings anymore.
In new forms you'll need to do the same manually: after placing the field to the form convert it to combobox then setup correct Row Source, Column Count and Column Widths properties of combobox.

How to edit an existing record and not create a new one when using subforms in Access?

I have an access database that holds medical information. It holds quite a bit of information so i have grouped like fields together into individual tables and linked them using a common primary key. I have created a tab style form with subforms on each tab.
Some of these subforms contain fields from only one table, however there are a few subforms where i have included fields from more than one table.
For example, i have a table that holds blood transfusion data and a table that holds patient characteristics. Some Fields from the blood transfusion table and patient characteristics table are in the same subform, but I also have fields from both these tables in other subforms.
When i try to insert data into the sub-forms with fields from multiple tables i get the following errors..
update or cancelupdate without addnew or edit
and
The changes you requested to the table were not successful because
they would create duplicate values in the index, primary key or
relationship. Change the data in the field or fields that contain
duplicate data, remove the index, or redefine the index to permit
duplicate entries and try again.
From researching the problem i gather this is because access is trying to create a new record for both tables, but if a record has already been created with that primary key (from inserting data into a previous subform) it won't edit the existing record.
Does anyone know how to get access to edit the existing record in this instance instead of trying to add a new record? I have basic skills in VBA but this is a bit past my level of experience.
Any suggestions would be greatly appreciated.
I used have a whole long response about split forms instead but I was having a horrible time getting it to work. So here is my new and improved answer for using subforms.
Here is a link with sub form info if you want to brush up for your purposes https://support.office.com/en-us/article/Create-a-form-that-contains-a-subform-a-one-to-many-form-ddf3822f-8aba-49cb-831a-1e74d6f5f06b
Step 1
Make sure your main form is bound to the right table.
For my purposes I used a single combo box on my main form to search with. Make sure all the field parameters on your combo box are correct. This includes making sure the Row Source is correct and that you DO NOT have a control source entered.
Step 2
Don't press enter after making a selection in the combo box. To prevent people from hitting enter I created a dummy button at the bottom that says "Save and Refresh" but all it does it create a message window that pops up with "Save Successful". I find hitting enter creates the first error you keep getting. I'm not sure how to address this in a more sophisticated way yet.
Anything else that comes up I will add later.

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.