Access - preview what an update query will change - ms-access

I am using Access to update values within a sharepoint list.
I have the sharepoint list linked as a table, and an excel file with the changes also linked in. These are linked by Purchase Order Number.
I can do an update query and it will update the appropriate values into the sharepoint list. However I would like to "Preview" my changes before I commit them.
What I would like to do is:
Show the purchase order number (key that is common to both lists)
Show the value currently in the sharepoint list
Show what it will be updated to
Then finally tell it to go ahead and make the change
I know this is a basic question but searching doesn't seem to come up with anything similar.

Simply use a select query with the SAME criteria and send the results to a continues form with a “update” or “cancel” button. If the user hits ok, then you run your update/insert query as opposed to the select query that is displaying the data in your current form (or even report).

Related

Use List Box with Multiple Selection in Query

Given I've created an Access Form with a ListBox; property > other > Multi Select = Extended; which permits multiple selections.
User selects multiple items.
Clicks a button that creates a report in "Print Preview"; but this report is based on the query, and the query is based on the values in the form.
This is accomplished by using this in the query when viewing in Access Query Design View (not SQL):
Like ([forms]![padc]![V2])
Where the form name is padc and the value to compare is V2.
Previously, rather than the ListBox that might show 10 options, V2 was just a field with one value. A user would either type a partial value, such as jack*, and the report would pull every instance where this value began with jack; whether that was jack, or jackie, or jacko, or jackson, etc. The LIKE part of this permitted the "fuzzy" logic bringing about varied results. The query would run, and the report would show all the records with anything starting with jack.
My goal, really, is to have a user select one, two or three, or all the available options in this box, and have the report respond correctly.
I believe the ListBox will let me do this, provided I have all the right names in the table that is the source of the options available to choose from.
I set the listbox to "multi-select" to enable multiple selections on the form.
The form is happy. It can let me click/highlight one or several items from the list.
The query is not happy.
For the field V2, neither
Like ([forms]![padc]![V2])
nor
=([forms]![padc]![V2])
Will retrieve records to populate the report; regardless of whether or not just one value in ListBox is selected or multiple values. (Like = fuzzy, and = means exact match.)
Neither work.
Of course, if the query won't perform, then the report won't perform either.
How can I write the correct query in Access, using "Query View = Design View" and or SQL to get this to function properly?
If the answer is "it can't be done without using VBA" then please point me to the VBA solution that a 5-yr old can understand, because I have zero experience using VBA.
Folks have recommended I use VBA; specifically that I should incorporate the "IN() IN function" in some manner; but I don't comprehend this solution at all.
I admit to being ignorant; not stupid; but ignorant.

Access 2016 drop-down list appearing in Reports and Queries

In Access 2016 I have a table called 'Orders'.
I also have a Form (also called 'Orders') that we use to enter order information. On the form, one field in particular ('Company') is a drop-down list. The control source is a second table called 'Companies'. And the Row Source is a SQL Query:
SELECT [Companies].[ID], [Companies].[CompanyName] FROM Companies ORDER BY [CompanyName];
So, when the user is entering an order into the Form, he/she can select the company name from this drop-down list and it in turn updates the Orders table. All basic stuff, and it works fine.
Next, I created a query (also called 'Orders') and it is based off of the Orders table.
When I run the query in Access and view it as a Datasheet, I was surprised to notice that the Company field (IN THE QUERY datasheet) is a drop-down list. Not only that, it even lets me change the value - right here in the query! If I view the SQL for this query, I can see that it is a SELECT query. In my mind, a SELECT query is read only. So my questions are - What's a drop-down list doing in a Query, and WHY does Access let me edit the values directly in the query? Isn't this supposed to be read only?
Next question:
After verifying that all of the data I need is in the Orders query, I then created a report (called 'All Orders') and the control source for this report is the Orders query. (not the table).
When I view the Report in Design view, there's the drop-down list again. Why? I am just looking to add the Company name that the user selected when they completed the form. I realize that the form Control for entering that data (on the FORM) is a drop-down list. But here I am building a report and I just want the VALUE to appear here. Not the drop down control? (I know that when I print the report or view it on the screen, the drop-down boxes go away and all I see is the actual text). But my question is - WHY is Access showing me a drop-down list control on a report? and in a select query? The query and the report are no place for editing data. I just want the value that was selected.
That's because you've defined the lookup list in the table. If you do so, it propagates to queries and new reports and forms, and will be the default way to view the data everywhere you've placed it.
Open your table in design view, and change the display control for your field back to text box. Note that any forms and reports will need to be edited or recreated, for queries the change should propagate.

Creating a data-entry Form with multitable Query

I have a form in my Access Database that is used for students to scan their badge and log in. If their badge hasn't been registered, the form just allows them to enter their information. I'm running into a problem where I'm using a Query that pulls their badge number from the previous form (which is inserted into a table temp) and compares it to the table with their information on it.
The problem I'm running into is that when I do this, I can't edit the information in the form, nor can I add more to entries, and when I separate the query and try to just pull from the table externally
(BadgeNumber = [temp]![T2])
it just pulls up a messagebox asking for the value.
Does anyone have any suggestions for accomplishing this?

Access Application with SQL backend blanking form details

I have an ancient Access application that I've recently moved the data to a SQL backend using the SQL Server Migration Assistant, and almost everything is working except for one issue.
In the application, we have a form with another form inside of it. The outside form finds specific "issues" entered into the system, and then looks for a history record(the inside form) that is associated with this issue. If a history record is present, it works perfectly, as the record shows up in the embedded form just fine. However, if there is no history record yet present in the database, the entire details sections of the embedded form blank out entirely. The properties are all set exactly the same as when it was a pure Access Database, but now that I've switched it to pull from SQL using Linked Tables, the form is now blank when I don't have a record to pull from.
EDIT: I learned that there are two conditions that when both met will cause a form's details pane to go blank: (1) there are no existing records to be displayed, and (2) it is not possible to add a new record.
This means that the second condition is where my issue lies. I tried scrolling to the bottom of each of the linked tables in Access, and for the History records table, I was not able to add any new rows, but for the Issues table, I was. Something is keeping me from being able to edit this one table for some reason.
I think the behavior you described may happen when the record source of the subform (your "inner form") is read-only. When matching rows exist, they are displayed. But, when no matching rows exist, you can't add a row so the subform's bound data controls are disabled.
Open the subform in Design View. Select the form and open its property sheet (Alt+Enter). Find the Record Source property on the Data tab of the property sheet. If the property value is a SELECT statement, copy it and past into SQL View of a new Access query then switch the query to Datasheet View. If the property is the name of a table or saved query, open that object directly in Datasheet View.
Once you have the form's record source opened in Datasheet View, are you able to add a row? If not, make sure the SQL Server user has INSERT permission for the data source. However, even with INSERT privilege, Access may have linked the data source as read-only if it was unable to identify a field or combination of fields which uniquely identify each row. If that is the case, you may need to re-link the table and tell Access which field(s) to use as the primary key.

Access Form Field Logic

I'm trying to make access conditionally only show rows that meet a certain condition, allow me to give you some background info before I proceed :
I've created an Access form and linked it to a test DB on my machine. The particular table I am interested in contains the following (important) rows :
ID , Office, Name, SecurityNumber
The thing is, ID is not unique. There are two Office locations, and each Office has it's own set of unique ID numbers. This means that ID 10 here and there may or may not be the same person. (this data comes out of a legacy security system we're not looking to change yet, so I cannot change it)
But ID -is- unique to each Office.
SO! I created an Access form with TABS! Two tabs, one for each office. What I am trying to achieve now is :
Have the ID/Name/SecurityNumber fields for each tab populate with only rows that match it's particular 'Office' value.
Thank you for reading and thank you for helping! :D
If you want the data for the office locations presented in separate tab page controls, you could use subforms on the pages which differ only in the WHERE clause of the queries used as their record sources. So for the Office1 subform, the query could be:
SELECT ID, Office, [Name], SecurityNumber
FROM YourTable
WHERE Office = 'Office1'
ORDER BY [Name];
Then for Office2, the query would be the same except for the WHERE clause:
WHERE Office = 'Office2'
As I understand your question, that approach would do what you're asking for.
However, that's not really the easy "Access way" to do it. Instead consider a combo box control to allow your users to choose which office they want to view. In the code for the combo's after update event, either modify the SELECT statement used as the form's record source or create a filter expression an apply it.
Also, since you're pulling the form's data from SQL Server, consider whether you want your form to load every record for the selected office location. It may not be much concern if you have only a few to moderate number of rows for each location, but if you'll be dealing with multiple thousands of rows it could be. In general, you should try to avoid pulling copious amounts of data across the wire; pull sparingly instead ... only what you need for the immediate task at hand.