Interesting FastForms Trick. Enable the Double-Click

In an earlier article, I discussed the problems associated with FastForms date fields. I suggested using regular text boxes at that time, but what if you want to make them act like M2M date fields with the double click feature? In case you don’t know, when you double click a date field in M2M it automatically enters the current date.

Well, you would use VBA code to perform mimic that for your FastForms text box. How do you program that event? Well, the code would look something like this, but for the sake of simplicity, I’ll just pop-up a message box with “Hello World” instead.

Public Function m2mpageframe1_page1_txttest_DBLCLICK() As Boolean

    MsgBox ("Hello World")

    m2mpageframe1_page1_txttest_DBLCLICK = True
End Function

Now you will notice that there is no ctlTarget container involved, I have no idea why. As I mentioned before, FastForms can be inconsistent. However, this does not work, and it didn’t work when I added ctlTarget either.

So, how can it be made to work? Well, there are two ways to use code with FastForms. You can place it in your M2VEvents.prj file, or you can place that code directly inside the FastForms controls. I prefer the first option when it works.

Fast Forms

You can place code inside the FastForms controls instead of in the VBA project file.

Here is where the trick comes in. In the above picture, you will notice that I put a piece of comment code into the double click property of the FastForms control. When you do so, the code inside the control will activate, but your VBA code in the VBA project file will run as well. After doing so, I got the following:

Hello World

Cute trick huh? I originally discovered this on the Purchase Order (PO) Screen, but I have since tested it on other screens and it seems to work on all of them.

2 comments to Interesting FastForms Trick. Enable the Double-Click

  • Scott

    Can anyone say CR? Not that it will be fixed any time soon.

    This is just another perfect example of how a great tool fails to meet its potential due to lack of testing and bug fixing. It is hard for me to believe that M2M bothered to create such a great feature as VBA and then didn’t bother to take the final steps to finish it. As a programmer myself, I know I would never go to go to so much work only to leave such obvious bugs.

  • Fred Crawford

    A good item to add to my folder of M2M Fastform notes. With this new release, thank goodness I don’t have too many Fastform and VBA changes on primary M2M screens/forms and programs.

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>