Relative Content

Tag Archive for vbams-access

Using Docmd.SetProperty for width

I have a search which generates a Table “Found”. I wish to vary the width of one of the fields [Title] in the Table display (NOT Form or Report) using VBA. How do I use Docmd.SetProperty for width? I can’t figure out the syntax from what the help files display.

Pass a Variable to an Open Form

I want to pass a variable to another form which opens with OpenForm. My form open event does not seem to be called. Maybe I am not referring to it correctly. The print statement in the first subroutine is correct, but the Debug.Print “A” never happens. Also, once this variable is passed to the new form, how do I use it in an SQL statment?

How do I clean up a remote drive using a recordset?

I have a sorted record set (“NewTbl”) of the contents of a remote disk drive. This shows a great number of duplicated files and other anomalies. The record set holds the file name, its location on the disk and file type (extension). This allows me to assemble a string that should allow me to correctly identify any particular file. Using the Kill command I would be able to eliminate the duplicates. Generally speaking I’m OK with the logic of selecting the file I’m after but not so hot on the link to the disk using the available information. The code I’ve got together ( that doesn’t work is below). The line it fails on is “fl.Name = ThsHm & ThsFl & “.” & ThsExt” returning error 438 “Object doesn’t support this property or method”.

Clicking a button in another ms-access application via hWnd

I’m trying to write a piece of code in VBA that clicks a button in another access application.
I know how to do it when the application is written, e.g. in C#, via Windows API, e.g. FindWindow and SendMessage.
For the ms-access app, I can’t find the button handle. In Spy++, the application window is visible, but its button components are not visible.
How does ms-access handle buttons and how can it be done in VBA via Windows API?