vba

Create table with access VBA and format fields

[亡魂溺海] 提交于 2021-02-20 04:37:51
问题 I want to create a table using access vba with formatted fields. How do I format currency field with "standard" format while creating the table? Private Sub CreateTable_Click() DoCmd.RunSQL "CREATE TABLE Test( " & _ "[id] AUTOINCREMENT PRIMARY KEY, " & _ "[transaction_date] DATE, " & _ "[reference] TEXT(255)," & _ "[details] TEXT(255)," & _ "[debit] CURRENCY," & _ "[credit] INT);" End Sub 回答1: We use DAO for this. Here's an example. At the bottom, a Format is assigned to a field: ' Creates

Create table with access VBA and format fields

走远了吗. 提交于 2021-02-20 04:37:06
问题 I want to create a table using access vba with formatted fields. How do I format currency field with "standard" format while creating the table? Private Sub CreateTable_Click() DoCmd.RunSQL "CREATE TABLE Test( " & _ "[id] AUTOINCREMENT PRIMARY KEY, " & _ "[transaction_date] DATE, " & _ "[reference] TEXT(255)," & _ "[details] TEXT(255)," & _ "[debit] CURRENCY," & _ "[credit] INT);" End Sub 回答1: We use DAO for this. Here's an example. At the bottom, a Format is assigned to a field: ' Creates

This document must contain content type properties - Run time error - 2147216381(80041403)

点点圈 提交于 2021-02-20 04:30:07
问题 I save my file to the SharePoint folder(onedrive sync) using the following VBA code. Off late for some reasons not known to me the SharePoint properties are not displayed ActiveWorkbook.SaveAs fileName:=spath & e wherein spath is the SharePoint path and e is the filename. However, if a file is saved manually to the same folder then the properties appear. any help is appreciated For better understanding here is a screenshot of my query 回答1: If you cannot save the file directly to SharePoint,

Change drop down list items based on adjacent cell value in vba

假如想象 提交于 2021-02-20 04:29:08
问题 I have an excel sheet where I have a table with two columns and variable number of rows. Some of these rows will be filled and some empty. Column B contains some values and Column A has a drop down list in each cell. I want that if column B cell has some value then the adjacent column A cell should show 3 options in the drop down list - MODIFY, ADD, DELETE and when column B cell is empty then the adjacent column A cell should show only one option in its drop down list - ADD. Can it be done

How to move the items from one listbox to another listbox

烈酒焚心 提交于 2021-02-20 04:25:47
问题 Using VB6 In a form, 2 listbox name as list1, list2 and 4 buttons name >, >>, <, << I want to add the list1 selected items to list2 I want to remove the selected items from list2 to list1 How to do this. Need Vb6 code Help 回答1: Generally, your approach will be to loop through the index values of all items in your source ListBox. If you're moving all items on the ListBox then for each item you'd call the AddItem method on your destination ListBox (using the index value to retrieve the text of

Scrape with xmlhttp

╄→尐↘猪︶ㄣ 提交于 2021-02-20 03:50:41
问题 I would like to get data from https://www.goaloong.net/football/6in1 This page contains a table. I tried with: Sub REQUESTXML() Dim XMLHttpRequest As xmlHttp Dim HTMLDoc As New HTMLDocument Dim elem As Object Dim x As Long Set XMLHttpRequest = New MSXML2.xmlHttp XMLHttpRequest.Open "GET", "https://www.goaloong.net/football/6in1", False XMLHttpRequest.send While XMLHttpRequest.readyState = 200 DoEvents Wend Debug.Print XMLHttpRequest.responseText HTMLDoc.Body.innerHTML = XMLHttpRequest

Scrape with xmlhttp

老子叫甜甜 提交于 2021-02-20 03:50:21
问题 I would like to get data from https://www.goaloong.net/football/6in1 This page contains a table. I tried with: Sub REQUESTXML() Dim XMLHttpRequest As xmlHttp Dim HTMLDoc As New HTMLDocument Dim elem As Object Dim x As Long Set XMLHttpRequest = New MSXML2.xmlHttp XMLHttpRequest.Open "GET", "https://www.goaloong.net/football/6in1", False XMLHttpRequest.send While XMLHttpRequest.readyState = 200 DoEvents Wend Debug.Print XMLHttpRequest.responseText HTMLDoc.Body.innerHTML = XMLHttpRequest

Create a table and reference it

前提是你 提交于 2021-02-20 03:45:33
问题 I am trying to read every two lines of text, create a slide, and insert each line in the cells of a 2 by 1 table respectively using VBA code. Public Sub newSlide() Dim FileNum As Integer Dim DataLine As String Dim Count As Integer Count = 0 FileNum = FreeFile() Open "C:\Users\ADMININST\Documents\my.txt" For Input As #FileNum While Not EOF(FileNum) Count = Count + 1 Line Input #FileNum, DataLine ' read in data 1 line at a time ' decide what to do with dataline, ' depending on what processing

Connecting Ms Access Db to Mysql through Vba

只谈情不闲聊 提交于 2021-02-20 03:40:23
问题 I have been trying to connect mysql database to ms Access but no result.I don't think personally I am using the DAo.Connection and the workspace properly. I keep on getting the 3001 connection error when I set mySqlCon . I guess my arguments are not properly set but I was following an example from here. Function connectingMySql() Dim mySqlCon As Dao.Connection Dim wrkODBC As Workspace Set wrkODBC = CreateWorkspace("newODBCWorkspace", "admin", "", dbUseODBC) Set mySqlCon = wrkODBC

Excel VBA Web Scraping Table Elements from a <frameset> and a <frame>

你。 提交于 2021-02-20 03:36:15
问题 I am trying to scrape some table-looking items from a website into Excel. I'm no stranger to coding in general, though I'm pretty new to VBA in an Excel sense :) I have tried using Excel's Data>From Web interface, it's not recognizing the table. I'm guessing it's because it's built using (or at least that's what my Google-Fu has lead me to understand). Snipping of what the second table looks like <html> <frame title="links" ...>...</frame> <frame title="queue"> #document <head>...</head>