'Me.' macros in Access...HELP!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • triafrog
    New Member
    • Nov 2008
    • 1

    #1

    'Me.' macros in Access...HELP!

    Ok - so this is my first go-around w/ macros - I have a form where there is a field "Contact Type" now when this field gets updated, I want Access to automatically put a date in my "StatusUpdateDa te" field. Though a little research I found that I could put in the Me.StatusUpdate Date=Date in the "Contact Type" After Update property, but this gives me an error of Microsoft Cannot Find the macro 'Me.' --- do I have to create one? If so how?

    I didn't initially want to use macros but if I can get this 'Me.' thing figured out I could definitely use it in other areas here and save myself a lot of manual time updating....tha nk you in advance!
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi. If you are really using an Access Macro (and not VBA code in the After Update event of the control) you are mixing different things. The Me syntax is VBA shorthand for the current form (or report if the code segment related to a report and not a form). You can't use the Me.{property} syntax in an Access macro, but you can in VBA.

    Me in a code module on a form is shorthand for
    Forms("your current form name")
    (as one among many ways to refer to individual forms in the forms collection)

    I suggest that your simplest solution is to right-click on the After Update event property of the control concerned and select build, code to open the VBA editor with a skeleton After Update subroutine ready to populate, then fill in the part you have mistakenly placed in the macro in the VBA code instead.

    There are many similar examples on this site.

    -Stewart

    Comment

    Working...