ms-access-2010

Dynamic SQL column value duplicate and difference detection merge query

白昼怎懂夜的黑 提交于 2019-11-29 17:30:00
I have n -columns that may contain unique or duplicated values meaning each column may have different values or the same ones. What I want to achieve is an MS Access script that can analyze n -columns that could do the following: If the columns if only one has a value and the rest are blank then the final value will be the only one seen ( Note : this one is already accomplished). +-----+----+----+-----+ |Var1 |Var2|Var3|Final| +-----+----+----+-----+ |1 | | |1 | +-----+----+----+-----+ | | |3 |3 | +-----+----+----+-----+ | |yes | |yes | +-----+----+----+-----+ If there are more than one

Refresh MS Access Form/Query Based On Combobox Value

吃可爱长大的小学妹 提交于 2019-11-29 16:58:19
Pretty simple explanation. I have a table with 10 entries, 5 entries with the year 2010 and 5 entries with 2011 in a column. In the query I have, I use Like *2010 to filter out all entries equal 2010 and display onl those records. On my form, I have combobox being populated with each unique year (from a different table). So my combobox values are 2010 and 2011. Is it possible, when I select say 2011, I trim the right 4 characters and use as my Like criteria to refresh and requery the form, all done within VBA? You can refer to the value of a control in a query run from within an Access session

MS Word, Import Table with Query Condition Based on Merge Field

感情迁移 提交于 2019-11-29 16:57:08
I'm creating a compliance mailing for my organization, the mailing will include merge fields that identify the office location, physician, and SiteId. The mailing will also include a table of information that is dependent upon the particular SiteId. I'd like to use the import table function of MS word and set up a query that references a merged field (SiteId) so that the inserted tables populate the appropriate data for the particular site. I'm unable to do this. How can I set up this document so that I can import only records from my source (an ms access query) that match the SiteId merge

How do I keep the necessary decimal places when using the DoCmd.TransferText command to export a table to a .csv?

假如想象 提交于 2019-11-29 14:50:35
I am using the DoCmd.TransferText in MS-Access-2010 VBA to export a table to a .csv file. However when I do this the resulting .csv file truncates the information in the table. For example the longitude -85.350223 becomes -85.35. How do I make it where the resulting .csv file is still comma delimited and keeps the full information from the table? If I need to create an Import/Export specification and reference it in the command line using the SpecificationName feature of DoCmd.TransferText (assuming I have correctly interpreted this feature as a formatting tool) please explain how to do that.

How to insert ADO Recordset into MS Access Table

£可爱£侵袭症+ 提交于 2019-11-29 13:58:18
问题 PROBLEM I want to insert the current recordset row into a MS Access table. I am currently getting this error Syntax error (missing operator) in query expression 'rs[columnname]' CODE Here is my current code, I am trying to grab all the columns and insert them into a new table. DoCmd.RunSQL "INSERT INTO tblSummary_Appl_Usage_score VALUES (rs[Configuration], rs[User Input / Output])" I am not quite sure what i am missing. 回答1: If the type fields in your table tblSummary_Appl_Usage_score are

Declaring & Calling The Sleep API

浪尽此生 提交于 2019-11-29 13:55:38
I have read many threads on implementing the Sleep API however most are a step ahead of where I am at in terms of knowledge to some guidance would be greatly appreciated. I have a macro in VBA which I would like to add pauses to, between steps (purely aesthetic rather than functional) however I am struggling with the basic declaring and calling. I understand that first I must declare the api and that the code for this is... Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) however, I am confused with regards to where this should go. Should it go in a module of it's own or

Corrupted Access .accdb file: “Unrecognized Database Format”

旧城冷巷雨未停 提交于 2019-11-29 13:25:41
I'm having a problem. One of my databases on our shared network will not open for any user. It says "Unrecognized Database Format." I've had this problem before but was still able to open the database, compact and repair, or import all of the database objects into a new database. The problem here is -- I can't even get it to the point of opening. Is there a solution here without the use of third party software to repair the database? Open access, go to the database tools tab, select compact and repair database. You can choose the database from there. WE had this problem on one machine and not

Random sorting query Access

≡放荡痞女 提交于 2019-11-29 12:18:30
I'm using this simple query to use a random sorting on a ms-access database: SELECT pk FROM TABLE ORDER BY Rnd(pk) asc And it's working fine when i test it with Microsoft Access 2010 However, when i call this query using classic asp, random sorting doesn't work. Here's my code: set Rs = Server.CreateObject("ADODB.Recordset") Rs.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/dbfolder") & "\dbname.mdb" Rs.Source = "SELECT pk FROM TABLE ORDER BY Rnd(pk) asc" Rs.CursorType = 3 Rs.CursorLocation = 2 Rs.LockType = 3 Rs.Open() do while not Rs.eof 'do stuff Rs

SELECT query does not work when converted to VBA - invalid SQL statement

坚强是说给别人听的谎言 提交于 2019-11-29 12:13:20
I have been struggling with SQL statement when converted to VBA. Basically, I wish to add something to it before executing (which shouldn't be a problem). However, when I try to run it before changes, VBA does not recognize it as a valid SQL statement. Despite trying to add/remove brackets and any other special character, it still does not work. Please note, that it works perfectly when run as a query. Please see the string below: SQLstr = "SELECT SourceData.[Fiscal Year], SourceData.[Fiscal Quarter ID], " _ & "SourceData.[Transaction Date], SourceData.[Sales Order Number], SourceData.

MS Access: Save form data to 2 tables at the click of a button

北战南征 提交于 2019-11-29 11:57:34
I am creating an asset management database with 2 tables (Assets and AssetMovements) and one form (Assets). I need to keep records of every asset movement, so every time a new asset is added to the Assets table or the 'Location' value for an existing asset record is modified, the record should be saved to the AssetMovements table. The AssetMovements table is just there to record the transactions. How can I achieve this? I would be grateful for any pointers I can get, or if anyone can suggest a better method of keeping the movement records. Thank you. Seeing you are using Access 2010, this