DBL Click - Macro Builder

mpquin

New member
Local time
Today, 06:26
Joined
Jan 16, 2008
Messages
7
Hoping I can get some help using the "Macro Builder" as I have no idea on how to use or write VB. Please redirect me if this is the wrong forum.

I have a subform that houses a list of contacts by the firm number in the parent form. There is also another form within the DB that has additional contact information that is editable. What I would like to do is to "double click" on an individual record in the subform and have it open the specific record in frmContact.

As previously mentioned, I need to build an expression in the "Condition" field to specifically pull a certain record. I have attached a pic of the MacroBuilder as well as the DB itself.


Thanks for any help!!
Mike
 

Attachments

  • test.zip
    test.zip
    300.4 KB · Views: 256
  • Macro Builder - Need Condiotion Statement.jpg
    Macro Builder - Need Condiotion Statement.jpg
    50.1 KB · Views: 419
This is actually very simple VB code.

The easiest way to get the code you need is to create a button that opens the form. Using the wizard, you can match up the field that you're looking up.

Create a code block for the double-click event, then open up the code and paste the code from the button into the double-click code.
 
You don't want the macro condition, you want the Where Condition down below. I don't use macros, but in code it would look like:

DoCmd.OpenForm "frmROEdit", , , "RONum = '" & Me.RONum & "'"

for a text value. No single quotes needed for a numeric value.
 
Thanks for the quick reply!

I was able to make the double click work when opening the form from directly from subfrmAllContactsByFirm (not embedded withina form). However once I try to double click the subform from "frmFirmContacts", I am prompted to enter a Paramter Value. I would really like to avoid this to make it simple for end users. Any ideas?

Sorry for any lost details. This is my first database after 2 5 hour classes.

Thanks again!
 

Attachments

The reference changes when it's a subform:

[Contact Name]=[Forms]![frmFirmContacts]![subfrmAllContactsByFirm].[Form]![Contact Name]
 
Absolutely perfect...Thanks so much for the quick reply!
 
No problem; glad we got it sorted out.
 
this code touches on my current question. I have been able to accomplish everything shown in this thread, but what I dont understand is why the user needs to double click the record SELECTOR. There should be a way to allow the double click to occur in any field in the record on the subform, that is in datasheet view.

I've attached the form with subform that I am using. In this example, I cannot get the Dbl Click event to trigger when I double click the record, for example on the field containing "DEMASO, THOMAS M." but I am able to trigger the event if I double click the record selector on the left for that record. FYI, the double click event switches to the Point of Contact Maintentance tab and shows data for the selected record in this subform, and I have all that code working, I actually had it coded for the button shown, but would like to make the process more simple.
 

Attachments

  • form.JPG
    form.JPG
    60.9 KB · Views: 341
Where is the code? I would have it in the double click event of each control.
 
Thank you very much. I had the Dbl Click set up just for the form, but once I added the same code into the Dbl Click for the first field, it worked. Will put the code in for all fields in the subform.

ps. that seems like a no-brainer in retrospect. How could I have missed it? LOL
 
No problem; it's usually the simple things that trip me up.
 

Users who are viewing this thread

Back
Top Bottom