access-vba

get a number of unique values without separating values that belong to the same block of values

自闭症网瘾萝莉.ら 提交于 2019-12-29 07:57:30
问题 I'm OK with either a PL/SQL solution or an Access VBA/Excel VBA (though Access VBA is preferred over Excel VBA) one. so, PL/SQL is the first choice, Access VBA is second and Excel VBA is third. This is a very tough problem to explain. Please ask any questions and i will do my best to answer them clearly. I have the following dataset in a table called NR_PVO_120. How do i pick out a number (which can change but let's say, 6) of UNIQUE OtherIDs without excluding any OtherIDs under any fax

Importing a text with separators using VBA

两盒软妹~` 提交于 2019-12-29 07:42:00
问题 I am trying to automate the adding of new text files, which all have the same (known) layout. The columns are separated using tabs (the TAB button). My question is, is it possible to do this in VBA? Like, in the access wizard for importing text files? I am using the DoCmd.TransferText method in VBA 回答1: You'll need to go through the wizard once to make your specification file. TO do this import your text file like normal but before you get too deep into the wizard click on the bottom left,

MS Access RunCode Macro cannot find my procedure

心不动则不痛 提交于 2019-12-28 16:36:27
问题 I'm only posting this since I wasn't able to find a solution anywhere. I finally figured it out. Kind of silly really. When using the RunCode property within an Access Macro, I was trying to run a Sub from my global module. I was getting the error "The expression you entered has a function name that database can't find." I couldn't figure out what the issue was. I followed the advice of everyone that posted on this issue, which was mostly the following: Use () at the end of the procedure name

SQL Server Passthrough query as basis for a DAO recordset in Access

﹥>﹥吖頭↗ 提交于 2019-12-28 15:31:40
问题 We've recently created and migrated our Access DB backend to SQL Server. I'm trying to, using VBA code, create a connection to the SQL Server backend and run a passthrough query with the results stored in a VB recordset. When I try this, the query is NOT passing through. Dim db As DAO.Database Dim rs As DAO.Recordset Dim strConnect As String strConnect = "DRIVER=SQL Server;SERVER=55.55.55.55 SQLExpress;UID=UserName;PWD=Password" Set db = OpenDatabase("DBName", dbDriverNoPrompt, True,

Update an Access linked table to use a UNC path

て烟熏妆下的殇ゞ 提交于 2019-12-28 06:48:45
问题 I have an Access 2010 database A.mdb with a list of tables, one of which is a linked table, linked from another Access database B.mdb on the same server. These databases are on a development machine xxx.xxx.xxx.xxx , which is mapped on my computer as R:// , and they are afterwards published online on a yyy.yyy.yyy.yyy server. If I want to work on the database locally, I need to change the link to the table. But if I change it via filesystem (using the "Linked Table Manager"), the link becomes

Pivot on multiple fields and export from Access

拟墨画扇 提交于 2019-12-28 04:34:20
问题 I have built an access application for a manufacturing plant and have provided them with a report that lists different data points along a process. I have a way to generate a report that looks like the following. Batch Zone Value1 Value 2 etc. 25 1 5 15 25 2 12 31 26 1 6 14 26 2 10 32 However, there is demand to view the data in a different format. They would like one line per batch, with all data horizontal. Like this... Zone 1 Zone 2 Batch Value1 Value2 Value1 Value2 25 5 15 12 31 26 6 14

Splitting a Multi-Page MS Access report into individual pdf files based on a Customer ID?

杀马特。学长 韩版系。学妹 提交于 2019-12-28 03:12:46
问题 I'm looking to split a multi-page access report up into individual pdf files based on a Customer ID and then saving those pdf files based on the Customer Name (or ID). I've looked into 'printing'/'converting' the report into one massive pdf file and splitting it there, but some customer invoices span two+ pages, therefore splitting that one pdf file page-by-page doesn't work. Any help would be greatly appreciated; if anyone needs more clarification on anything, don't hesitate to let me know.

ConcatRelated() in complex database - parsing problems

删除回忆录丶 提交于 2019-12-25 19:01:48
问题 I have been tasked with concatenating values in a multi-table query or report, respectively. I have found Allen Browne's ConcatRelated() function, which appears to be doing what I want it to. I just can't get it to work, however. I know there are lots of different posts on this topic on stackoverflow, but I have read close to 30 of them and none solved my problem really. For better understanding, the database looks similar to this: Picture of relationship graph. What I need to do is output

issue with R script execution from Access 2016 command button

一曲冷凌霜 提交于 2019-12-25 18:28:22
问题 I’m trying to execute R script from Access 2016 command button. The script reads in a file and generates a plot from values inside the file. It works well when I run it from Windows 10 command line as follows: C:\Program Files\R\R-3.3.2\bin>Rscript --vanilla H:\R\analyze.R H:\R\LCH_22.vcf I would like to execute the R script from a button in Access 2016. Here is a vba script that I'm using: Dim file_path As String file_path = "H:\R\LCH_22.vcf" Dim RetVal RetVal = shell("""C:\Program Files\R\R

Changing Row Colour according to condition

為{幸葍}努か 提交于 2019-12-25 18:24:15
问题 I am using MS Access for database Administration. I have seeveral linked tables producing different reports. I have already found a similar question on stackoverflow and did my reaserach on this issue. I am trying to paint rows according to conditions (Duration <20 Paint Beige, 2060 Red) I am using VBasic. This is my code. Please let me know what you think. Many thanks for your help! Sub ChangeBackType() Me.Date.BackStyle = 1 Me.Cell.BackStyle = 1 Me.Maintenance_Category.BackStyle = 1 Me