Stumped as to why Access is asking me to enter a parameter - sql

I have a combo box called "manufacturer" that will update the combo box called "productName" but when I select the manufacturer, I get a prompt asking for the parameter. The SQL statement for the ProductName query is below.
SELECT ProductsTable.ProductID, ProductsTable.ProductName,
ProductsTable.ManufacturerID
FROM ProductsTable
WHERE (((ProductsTable.ManufacturerID)=[Forms]![NewComplaint]![manufacturer]))
ORDER BY ProductsTable.ProductName;
When the Manufacturer is selected, this is the prompt that is displayed.

The solution was quite unexpected: your database is corrupted in a way that I haven't seen yet (AFAIR).
After opening the form, I tried a few things in the Immediate Window that usally work without problems, and got various errors:
? Forms!NewComplaint.Name
Automation Error
? Form_NewComplaint.Name
Not enough memory
Compact & Repair and Decompile didn't help.
Solution: Create a new database, import everything from the existing database.
Now the combo boxes work without problems.
See http://allenbrowne.com/ser-47.html
(and for possible future problems: http://allenbrowne.com/recover.html)

Related

MS Access - "This Record Has Been Changed By Another User Since You Started Editing It"

I know this has been asked many times, and I have tried many of the suggestions and solutions that worked for others, but I am not able to get this error to go away (please see attachment).
This is an Access application that is really just a UI to a SQL Server database, and uses all linked tables to the SQL Server database. The user opens access and they go to a form that opens a "Search", where the user selects a bunch of criteria and clicks "Apply Filter". A list of records appears that meet their criteria. They click the record they want, and a form is opened that displays the details about this record. They then click an "Edit" button that opens another form that allows them to edit certain fields. When they make changes and hit save is when this error appears. The odd thing to me, this only occurs if the user selects the first record in the Search list, but it doesn't seem to happen with the others in the list.
What I have tried is the following:
Added code on the "BeforeUpdate" and "Update Button Click" event to check "If Me.IsDirty = True Then Me.IsDirty = false" End If.
Added a datetime column to the SQL database that gets updated with a trigger ON UPDATE
Verified the database has no bit columns
Changed the "Record Locks" property on the form to "Edit Records"
None of these items made a difference.
Any help on what might be causing this is appreciated.
2. Added a datetime column to the SQL database that gets updated with a trigger ON UPDATE
This could actually be the cause of your problem - Access and Sql Server modifying the same row at the same time is causing the write conflict you see.
I'm afraid you have misinterpreted the valid advice you found.
What you want is a ROWVERSION aka TIMESTAMP column in your Sql Server table. That helps Access figuring out if a row has changed and solve write conflicts. It is fully automatic and needs no trigger.
More details (Albert always provides lots of details :p ) here:
MS Access Write Conflict - SQL Server - Me = Dirty
If this doesn't help: check if you have any other triggers, and post your VBA code for filter / edit / save.

MS-ACCESS 365 Write Conflict Issue

After my Access got upgraded to Office 365 i'm starting to get write conflict issue whenever i edit a particular record. I was not getting this error in 2010 version.
Access database has 1 query used to filter out selected record for editing and 1 form (no subform). On some records i was able to update, but on some records i'm getting a write conflict. I'm using a run command DoCmd.RunCommand acCmdSaveRecord to save each record that is updated. Do you have an idea why changes are saved on some records and why a write conflict on some. There's no other users editing the record.
Thanks
Whenever I have issues with msaccess that I cannot explain, I do the following:
1-) Create a new msaccess empty file;
2-) Import all tables / queries / forms, objects to this new msaccess file
It normally solves this kind of issue.
I had this issue with some of my clients in the past; Most of the times it is resolved by applying the following instruction:
Select File > Options.
In the Access Options dialog box, select Current Database.
Under Application Options, select the Compact on Close check box.
Select OK.
Close and reopen the database for the option to take effect.
More details are here: https://support.microsoft.com/en-us/office/compact-and-repair-a-database-6ee60f16-aed0-40ac-bf22-85fa9f4005b2
You might have a bit field in your table that allows NULL, making it a triple-state field. Whenever you attempt to save your record, if it is null, it can raise this "Write Conflict" error.
The solution would be either to explicitly assign a value to it before saving, or use a default. Alternatively, if you have a bound control to it (like a CheckBox), set its Triple State property to False.

What is the simplest way to put Data Flow Task's name into Variable is SSIS ?

i have a package in SSIS where i try to put data flow task's into a variable, once the data flow tasks fails.
What is the best way to do that ?
Please share screen shots if you can,
thanks in advance,
There are only a few steps and involve the use of an expression. Listed below is an example using an Execute SQL Task. Note that I'm applying SQL Server 2008 R2 with BIDS. Later version may differ somewhat.
Steps:
Create a new user variable called "SQLTask" with a Scope of "Package", Data Type "String" and a value of "SQL - Process Employee SQL". (It is a good idea to name your control and data flow tasks clearly. You'll be grateful later when troubleshooting.)
Add an Execute SQL Task into the Control Flow. Double-click on it to view the Execute SQL Task Editor.
On the left side of the Editor window, select Expressions. When you do so you'll see "Misc" with Expressions appearing on the next line underneath.
Select Expressions under Misc and then select the small browse button icon when it appears. This should open the "Property Expression Editor" window.
The Property Expression Editor will show two columns, Property and Expression. Select the empty box under Property and select the drop-down when it appears. Scroll down until you find "Name" and select it.
In the right-column under Expression, select the empty box to the right of Name and then select the small browse button when it appears. This will open the Expression builder window.
In the Expression builder window there will be two list areas at the top, with the one on the right showing "Variables". Open the Variables folder, which should then list mostly System variables. But the one just created will be prefaced with "User" called "User:SQLTask". Drag it into the Expression box below.
Select the "Evaluate Expression button". Doing so should now show "SQL - Process Employee SQL" in the grayed-out "Evaluate value" box. It confirms that it is correctly picking up the variable value.
Select the OK button in the Expression Builder window.
Select the OK button in the Property Expression Editor window.
And select the OK button in the Execute SQL Task Editor window.
While the task name from the variable does not get captured when viewed in the Control/Data flow, it will show up when a failure takes place. But because of this, it would still be a good idea to use clear task names in your SSIS package for yourself and others who need to understand the logic/decisions in the process.
On that note, I always recommend a good consistent naming convention for control and data flow tasks beginning with the recommendations discussed in the following link.
Suggested Best Practices and naming conventions
Hope this helps.

Update multiple records in SQL from Access without error "The data has been changed"

I am working with an ODBC connection between Access 2013 front end and a SQL Server 2008R2 back end. I have both “Datasheet” and “Continuous” forms that display multiple records which are sorted on an “order” field (integer).
The record source of these forms is a query (an Access local query right now, but I don’t think that switching it to a SQL Server view will solve my problem). Users use these forms to set/update the order of their records for reporting purposes.
My problem: the forms are updateable, but keep throwing the error
The data has been changed. Re-edit the record.
I know this error can be solved by setting the respective form to re-query after every update, but that is equally frustrating to the user because then their records are constantly re-sorting on them as they are trying to set the order (and the form "blips" after every entry).
(I have the field "Timestamp" in all my tables. I know a similar error is raised if one does not have this field in a SQL BE database linked to an Access FE.)
What is the best way to allow the users to update the order of all their records without the form resorting on them? (I would like to keep the “sort” in the query on the “order” field so when they open the form next time it displays the records in the order they specified.) I’ve read about using unbound forms with a stored procedure to update the SQL data, but this seems to be useful for one record at a time. Could I use a temp local table, and then do a batch update with a stored procedure? If that is the best answer, I also ask for some example code to get me headed in the right direction. :)
A simple answer! Add Me.Refresh to the AfterUpdate event on the form or subform. Then when a user does want to update the form based on their new order, they can click a "refresh" button that is set to Me.Requery or Me.Parent.Requery depending on the form or subform, respectively.

Allow Drop Downs in an SSRS Report (2008) to accept text as an input

Okay, so I have an SSRS report that has a parameter with available values from a query. All of this works fine, but I would like the user to be able to select multiple items using: "SomeText%" which will retrieve all like: SomeText12, SomeTextHeyThere etc. The sql for this is all set up, but once you set the parameter to get values from a query in visual studio, you don't have the option to enter in text as well. This seems like it should be a common feature. Does anyone know how to add it so that the user can enter text and select from the drop down at the same time? I can create 2 parameters to do this, but that is just clunky.
Thanks!