"Update to" table values not loading during simple update query - ms-access

Started a new job with the most recent version of Access and can't find an answer to this -
When doing a basic Update query linking two tables I want to update a field in Table 1 to a field in Table 2 - every version I've had for the past 20 years gives you a drop down menu of the table fields available in the "Update to:" line but not this version?? I can type it out of course but I miss my drop down menu. Any ideas how to get this back?
Thanks in advance for any help.

In Access 2013, go to Design > Query Type in the ribbon and select Update. The grid will change to show your Update To: dropdown.

Related

Deleting/Copying the data from Database with specific condition in mySQL

I am looking for an Idea to handle data in DB directly.
Here is my use case
I have table “EVENT_REGISTERED” with column (ID, Event_name,Event_DateTime)
I want to display the EVENT_REGISTERED in the fronted end whose date and time is not passed. i.e. I want to display only Upcoming event not Historical events.
Of course this can be handle with JS code before displaying.
But What I want is there should be some sort of a trigger which will delete the Instance form the “EVENT_ REGISTERED” table and copy it to another Table “HISTORICAL_EVENT”
I cannot Create an MY SQL EVENT to do this as it like batch job and I cannot run this every 5 mins as there can be more than 10000 rows in there.
I see Trigger option as well, I am not sure how to use this as it says that it will be activated after the specific action is executed. Here the specific action is CURRENT_DATETIME == EVENT_DATETIME.
Can anybody give me a direction or any sort of alternative way to achieve this?
**I am not an Expert of MySQL*
Thank you
Regards
Prat
Don't start moving rows between tables. Simply run a query:
select er.*
from event_registered
where er.event_datetime > now();
With an index on (event_datetime), performance should be fine.

Trying to pull data from text boxes on a form into a query and out to a table?

I posted a couple times over the last couple of days about some trouble I'm having with an inventory database that I'm trying to make at work. I have very little experience, so have been mostly following YouTube tutorials and walk throughs online.
Essentially I have a table that will be filled with inventory information such as ID number, manufacturer, model number, etc. I then have a form that has a text box for each field in the table that the user will fill in and then an Add, Delete and Edit button that will allow them to either Add a new record by filling in the text boxes and clicking Add or select a current record in the table from a combo box or list and edit it or delete it by clicking the associated buttons.
I tried to code this first and kept getting an error for the past two days no matter how much I tried to fix it and what advice I got on here, so now I'm at the point where I'm just using queries to do it.
Right now I have a main table, temp table, the form, and then these queries:
1. delete query that will clear the temp table
2. append query that will take the records from my temp table and add them to my main table
3. append query that will take the selected record on form and add it to the temp table
4. update query that will update the fields on the main table to the data in the temp one
5. delete query that will delete the record you select on the main form from the main table
This was my plan:
for adding a new record
1. run query no.1
2. load the form
3. if OK button clicked:
4. run query no.2
for editing
1. run query no.1
2. run query no.3
2. load the form
3. if OK button clicked:
4. run query no.4
for deleting:
1. load a msgbox with the YesNo options
2. if Yes button clicked:
3. run query no.5
The one I'm having trouble with is query number 3. I've made the query correctly to the best of my knowledge, but when I fill out the form and click add it tells me the query is going to append 0 rows and then it doesn't add anything to the temp table.
I also can't seem to figure out how to take the data from the temp table and move it to the main table using the query.
I'm linking to an IMGUR post with screenshots in it here:
http://imgur.com/a/ffWge
Any ideas?
I hesitate to answer this since there are too many points to cover. Gustav already gave great advise about learning to use Access Forms like they are intended. But from the screenshots, it looks like you misunderstand something fundamental about the Access query designer. Even though you shouldn't have to write any queries for want you want to do, at some point you will need to understand how to properly design a query.
If you want the query to insert FROM the form INTO the table, then the table field references should not be in the criteria, they should be like this:
Field: [Forms]![frmInventory]![ICN]
Table: {leave blank}
Append To: ICN
Criteria: {leave blank}
Also, remove [tblInventoryTemp] from the query window since you already specified the destination table in the Append Query pop-up window. The SQL should look something like this:
INSERT INTO tblInventoryTemp ( ICN, model, serial, ... )
SELECT [Forms]![tblInventory]![ICN], [Forms]![tblInventory]![model], [Forms]![tblInventory]![serial], ...
Likewise for the other query to copy from temp to the main table. You should have already specified the destination table in the pop-up window, so remove [tblInventory] from the query window. Also remove the list of fields you have in the Criteria row. The SQL should look something like this:
INSERT INTO tblInventory ( manu, model, serial, ... )
SELECT tblInventoryTemp.manu, tblInventoryTemp.model, tblInventoryTemp.serial, ...
FROM tblInventoryTemp
Access will likely add more details, but the general form of the SQL should match what I have.

Create choicebox for MS Access 2013 Table cell

One of the columns in my table is Status, and I want it to display 1 of the following 4 options:
Active, Not Active, Done, New
Is there a way I can create an enumerated list with these 4 choices and then force the user to choose one of those options when they click on a cell in the Status column?
I saw people posted similar questions, but they were all referring to using forms. Is there any way to do this in a table?
You can create a lookup field in a table in any Access version 2010 or after. The lookup field can utilize a table, query, or value list as its row source. See this article for more information.

Data filtering on form generates "Could not find field"

I spent half day trying to figure out why appears an error messagebox
Could not find field 'TransactionTypeID'
in my
database. If you open Form1, then apply any filter on column TransactionTypeID using header (for instance, uncheck Blanks) and then try to open sorting/filtering for second column, appears error message.
Error disappears if I convert combobox to text box or remove from form select table Tenants1. I use Access 2010 32 bit. In this example I simplified tables as much as possible, database created from scratch, data imported, compact/repair doesn't help.
Do you have any ideas?
I found the problem. The built-in datasheet form filtering works in a wrong way if tables joined this way:
SELECT VouchersMain1.VDate, VouchersMain1.TransactionTypeID
FROM Tenant1 INNER JOIN VouchersMain1 ON Tenant1.TenantID = VouchersMain1.TenantID;
If I reverse tables join direction, built-in filtering works fine:
SELECT VouchersMain1.VDate, VouchersMain1.TransactionTypeID
FROM VouchersMain1 INNER JOIN Tenant1 ON VouchersMain1.TenantID = Tenant1.TenantID;
Looks like this is another Access bug.
Also, thanks #Munsterlander, problem disappears if form's recordsource replaced by saved query instead of SELECT
Try referencing your field as Forms!FORMNAME!CONTROLNAME. I assume, based off what you wrote, you are trying to filter a query based on what is selected in the combobox.
Delete the table Tenants1 from your form RecordSource (this table is not necessary and do not exposes fields in the resulting query).
You would also note that your recordsource is set (by Access) ReadOnly (bad design, no join defined). Try to add a couple of Records in the Tenant1 table, say it David and Nathan.
You will find that now your query will output 6 records (and not 2), because the query (with no joins) list one row for all records of table Tenant1 (3) and one row for each record of table VouchersMain1 (2), giving a total of 2*3=6 rows.

Copy/Paste records in Tables that have autonumber => same ID until refresh

I have a silly nuisance on an error.
I have access front end and sql back end.
In a form with a Record Source: Select * from ViewX(View of 2 tables each with autoID)
The problem is..I copy a row and paste it underneath..it works but the AUTOID column doesn't update...I have to manually press F5 to reload the whole thing and THEN it updates..
ViewX(Removed some details):
SELECT TOP (100) PERCENT dbo.Trial.TrialID, dbo.Culture.CultureID, dbo.Culture.Crop
FROM dbo.Trial LEFT OUTER JOIN
dbo.Culture ON dbo.Trial.CultureID = dbo.Culture.cultureID
TrialID and CultureID are identity columns in their own tables.
Any ideas?
You're trying to paste a number into an autonumber field. First of all, can you do this in code? Secondly, do you really NEED to see that autonumber immediately? The table needs to refresh, so whether you press F5 or whether you close the table/query, either one will update the autonumber. The next time you open it, you'll see the new number.
I was able to fix the problem by forgoing the View and just have access select from the 2 tables directly..which the View was doing.
My guess is that access wasn't able to get the new ID because the insertion was not direct. It required a trigger because it affected 2 tables and that INSTEAD OF INSERT trigger screwed up with access..just a guess but I am happy it worked.