Browse by Tags

All Tags » VBA (RSS)

Don't forget the small touches - Invoice number and Set date range to last month

I'm just finishing up adding customer invoicing functionality to my Fleet Management app. One bit of functionality a client requested was the ability to know if a customer service order had been invoiced separately by the branch office accounting...
Posted by Tony | with no comments
Filed under: , ,

Compile error: Sub or Function not defined

As a follow up to my previous blog entry Compile error: Method or data member not found here's the identical VBA IDE problem but due to a function name not found. In the above screen shot CalcPrice is the undefined function yet the VBA showed the...
Posted by Tony | with no comments
Filed under: ,

Setfocus and subforms - 2165 "You can't hide a control that has the focus."

I was quite puzzled. I wanted to setup some fields on my Fleet Management System so that the user could toggle off or on the item cost or price. For example they might want to do up a quote for someone and just show the price. (Hmm, I'll have to add...
Posted by Tony | with no comments
Filed under: ,

Compile error: Method or data member not found

I'd forgotten about this bug in Access 2003 VBA. I was getting the message Compile error: Method or data member not found but the me. control was just fine. In fact I could see the control in the line above. I spent about 10 minutes trying things...
Posted by Tony | 2 comment(s)
Filed under: ,

File Compression using the OS and NTFS file system

Thanks to a question in the newsgroups I did some research and updated the Microsoft Access Compatible Compression Solutions page with the below File Compression using the OS and NTFS file system section (And I renamed the web site page from Microsoft...
Posted by Tony | 2 comment(s)
Filed under: , , ,

References

Paul asked "I sometimes get frustrated that Access does not always update references between versions...for example a calendar control or Outlook reference" 1) Use a calendar form or the API calls which is what the calendar control uses behind...
Posted by Tony | with no comments
Filed under: , ,

VB/VBA line numbers

So you're looking at this posting and thinking "how retro". What is that old fart Tony up to? Well, yes, I did use line numbers a lot when I first started as a programmer in this business almost thirty years ago. The IBM 5110 computer booted...
Posted by Tony | 2 comment(s)
Filed under: ,

Minor unexpected behavior in VBA DIR function

This is exceedingly minor. However the following example brought two different results. ?Dir("Q:\1 access\Fleet Mgmt\*.key") PD.keyzzzz ?Dir("Q:\1 access\Fleet Mgmt\pd.key") <nothing> Background. For my "shrink wrap"...
Posted by Tony | 2 comment(s)
Filed under: , ,

Fetching the reference description

I've always been irritated at how you can't get at the user friendly reference description as displayed in the Access VBA References screen. When you look at the properties of the reference object you can't see the user friendly name you see...
Posted by Tony | 5 comment(s)
Filed under: , ,

Looking for Access constants?

Say you're creating fields on a table using VBA and the field collections. You're trying to figure out what the possible values are for the field types. And you've managed to figure out something like the following code. Dim dbsupdate As Database...
Posted by Tony | 4 comment(s)
Filed under: , ,

Returning multiple files from the File Open Dialog API?

The above question was asked in the newsgroups - File Dialog Using API . Tom Wickerath, fellow MVP, found the answer in another newsgroup posting Get External Data . Note that Doug Steele, fellow MVP, commented "When using multiselect, what's...
Posted by Tony | with no comments
Filed under: , ,

Updated the Microsoft Access Email FAQ - Directly via the Winsock page

Microsoft Access Email FAQ - Directly via the Winsock to include a link to Email Sending UserControl . VB 6.0 code which should be easily adapted to VBA. Note that I haven't tested this.
Posted by Tony | with no comments
Filed under: ,

Shifting fields left on a continuous form

I have a field on a continuous form that is only occasionally visible. Yet, when visible, I'd like it to be right next to another field. And I don't want to leave an ugly gap in the middle. See Shifting fields left on a continuous form in Microsoft...
Posted by Tony | 1 comment(s)
Filed under: , ,

Let's Talk about Office VBA Help

A rather interesting blog entry about Office 2007 online VBA Help. Let's Talk about Office VBA Help
Posted by Tony | with no comments
Filed under: , ,

Debugging intermittently failing VBA code

I had a problem where an API call would work when stepping through the VBA code but would intermittently fail crashing Access or give an "out of memory" error. (Out of memory is Access's default error message when it doesn't know what...
Posted by Tony | with no comments
Filed under: , ,

Self Documenting Code

I completely agree with the Self Documenting Code posting. Below is some sample code for summing up all the costs of a service order with a small number of comment lines. That's about right I'd say. Now some may quibble with some things in that...
Posted by Tony | with no comments
Filed under: ,

What I always keep forgetting about IsMissing

like using IsMissing when appropriate on the argument list of a subroutine or function. But I keep forgetting that I have to then declare that variable as a variant. Good: Sub SendQuerytoExcel(strQuery As String, Optional strXLSName As Variant, Optional...
Posted by Tony | 1 comment(s)
Filed under: , ,

goto

goto (I love the cartoon's disclaimer.) That said I do use goto's in one major situation. At the beginning of any routine to check conditions and immediately exit. For example if I want to update some rates has the service tech rate been entered...
Posted by Tony | with no comments
Filed under: , ,

Page with sample VB code for Serial Port IO

Thanks to christianlott1 at yahoo dot com for posting in the comp.databases.ms-access newsgroup. Perform Serial Port Communication - The sample code linked to this page consists of a VB module containing a collection of routines to perform serial port...
Posted by Tony | 2 comment(s)
Filed under: , ,

Mousewheel not working in the VBA editor?

I used to use either VBScroll or FreeWheel . But there is now an official Microsoft solution. Mouse wheel events do not work in the Visual Basic 6.0 IDE . I'd suggest staying away from an old version of the Intellipoint software.
Posted by Tony | with no comments
Filed under: ,
More Posts Next page »