vba

Table/Form design; Record/user has Multiple addresses, selected the address that is the contact

Hi there, Looking for advice as to the correct method of solving this design issue I have a table for a profile / record (tblProfile), each profile can have more than one address / property (tblProp) I have a form for adding a profile, and a seperate form to add an address. What would be the correct method for allowing the selection o...

How to wrap comment.text in vba

I have a situation in which text in one of the cells is massive.When I change the contents of this cell the previous value becomes a comment to that cell.Now the problem is, this text is so big that I cannot see complete text.If I use .Shape.Textframe.Autosize=true then I have to go on browsing till god knows when to see the text. What ...

data source name not found and no default driver specified. Microsoft OLE DB Provider for ODBC Drivers

Hello, i'm not a windows administrator, so I do not know what I'm doing wrong. I have this script to get vmware esxi3.5 reports, http://paste.ubuntu.com/493213/ I get this error: C:\Documents and Settings\admmarc\Desktop\test\vcreport. DB Provider for ODBC Drivers: [Microsoft][ODBC Driver not found and no default driver specified...

Out of stack space in vba when running code for project euler #1

Option Explicit Sub peuler1() Dim x As Variant Dim y As Variant y = 0 For x = 1 To 999 If x Mod 3 = 0 Or x Mod 5 = 0 Then y = y + x End If Next x Call peuler1 End Sub Why is this taking so long? it doesn't seem to be too convoluted. ...

vba format function throws type mismatch error

I am trying to format a number as currency in Access VBA. In the immediate window, when I enter: ? Format(123, "Currency") I get the expected response: "$123.00" However, in the code window, when I enter: Debug.Print Format(123, "Currency") I get an error pointing to that line: "Run-time error '13': Type mismatch" Why does the s...

How do I keep MSXML from adding its own namespaces to my XML base64 encoded document?

I'm encoding a document to attach as a base64 encoded element inside an xml document for transmission. It's easy enough, I just slurp the entire file into a byte array and then use MSXML's nodeTypedValue to base64 encode the data as I put it into the element. The problem, however, is that MS XML then adds its own namespace and datatype a...

VBA error when executing a sybase stored procedure

Hello, I have the following code that executes a Stored Procedure in Sybase throught VBA. Sub GetInfo() Dim rstRUB As ADODB.Recordset Dim strRUB As String Dim strcnn As String Dim productType As String Dim DealId As String strcnn = "DSN=KONDOR_QUA;DATABASE=Kustom;UID=odbcuser;PWD=odbcuser123;" Set cnn = Ne...

vba iterations in from loop

is there a way to say in vba something like from x = 1 to 100, by 10 so that the x's are 1, 10, 20, 30, etc. to 100? ...

Avoid duplication without using Indexed fields and 'no duplication'

Hi there, I'm looking for advice as to the correct method for form design to prompt the user entering data to avoid duplicated records. For example: The user enters profile information in the fields firstName surName Its highly possible for numerous profiles to have the same name (e.g John Smith, so indexing fields isn't possible to av...

Compile Error in VBA code in MS Access

I have the following function in access, which was working fairly well. But now suddenly i am starting to get a compile error : Method or data member not found Function Serialize(qryname As String, keyname As String, keyvalue) As Long Dim dbs As Database Dim rs As Recordset Set dbs = CurrentDb On Error GoTo Err_Serialize Set rs = dbs.O...

This code works, but how?

I just wrote this function to read a series of email addresses from a linebreak-delimited text file. And it does work, but that's not my question. Function GetEmailArray(FileName As String) As String() Dim TempArr() As String Dim i As Integer Open FileName For Input Access Read As #1 Do While Not (EOF(1)) i = i...

A little buggy: Code to create, save,& open a Lotus Draft Email thru VBA

This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: It doesn't always open the right draft email for editing. It sometimes produces a "Notes Error - Specified command is not available from the workspace." error message. (The e...

What is &H20 and &HDF in VBA?

I am trying to grok the following piece of code: Mid$(strV, i, 1) = Chr$(intChar And &HDF) What does &HDF mean? I also have a similar section that uses @H20. I have Googled high and low and the most I found was nothing that I didn't already know about them...that they are constants. ...

How to consolidate data by domain in excel?

I have a spreadhseet that looks something like this: Referrer --- Clicks --- Conversions http://google.com/search?q=hello+world ---- 12 ---- 3 http://george.com ---- 4 ---- 1 http://google.com/search?q=yeah ----- 3 ---- 3 http://george.com/2010/3/this-blog ----- 4 ---- 0 http://www.wave-runner.com/hey ---- 3 ---- 0 How can I write a m...

get output as a vector in R during a loop

How can I get the output as a vector in R? For example, if I want to have for (i in 1:1000) {if i mod 123345 = 0, a = list(i)} a but I would want to find all i that divide evenly into 123345 (i.e., factors), and not just the largest one. ...

Using MS Word to directly query a db for mail merge

Currently, I'm using Excel 2002 with a ODBC connection to query an Oracle DB by User ID # and to return a set of parameters such as Name, Address, etc. to fill a mail merge form in Word 2003. I wanted to know where I could automate this process to the point that I would open up Word, be prompted for the User ID and being able to have the...

Comparing Strings in VB 6.5

I am trying to compare two strings in VB but compareTo, compare, equals etc all give compile errors. If String.Compare(string_one, string_two) = 0 Then ...do stuff End If If String.Equals(string_one, string_two) Then ...do stuff End If Now both lines give me the error Compile error: Expected: ( and it ...

Need regular expression expert: round bracket within stringliteral...

I'm searching for strings within strings using Regex. The pattern is a string literal that ends in (, e.g. # pattern " before the bracket (" # string this text is before the bracket (and this text is inside) and this text is after the bracket I know the pattern will work if I escape the character with a backslash, i.e.: # pattern " ...

What's a linked window?

I'm trying to familiarize myself with Visual Basic Add-In Model. I don't understand what LinkedWindowFrame and LinkedWindows properties mean. Could someone kindly explain a little bit? Thank you! Edit: There's a definition as follows: linked window A window that is joined to another window other than the main window. But I don't...

What's the fastest way to perform SQL functions (select, insert, update) in VBA on an SQL server database?

I don't know between ADO, DAO and DLookUps and such. Does anyone know? ...