Results 1 to 2 of 2
  1. #1
    Computer202 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    Lincolnshire, ENGLAND
    Posts
    25

    Post Reffering to the "Active" form in a calculation.

    Hey Guys...



    I have already spoken to someone of the forums regarding this. What I wanted was to take a value off a field in a macro.

    Assuming in this I have 4 forms, Frm1, Frm2, Frm3 and Frm4. Each of these have the same button which works on the same code to do a process which isn't relevant. Before it carries out the process I want it to take 1 of the field (QTY). This field is present in all the forms. At the moment I have:

    Form!Frm1.QTY = Form!Frm1.QTY - 1

    The problem with this being if I am on frm2 to frm4 this wont work... How can I set it to the active form instead of specifying?

    Cheers

    (Thanks pbaldy for help so far )

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Check out ActiveForm in VBA help. It will refer to the form that currently has focus.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Fields do not show in "Form View"
    By hawzmolly in forum Forms
    Replies: 4
    Last Post: 01-09-2010, 06:27 PM
  2. Replies: 3
    Last Post: 10-20-2009, 06:56 AM
  3. aSTR = Dir("C:\*.*") >> "Type Mismatch"
    By JGrant in forum Programming
    Replies: 1
    Last Post: 03-28-2009, 05:17 AM
  4. Replies: 2
    Last Post: 08-31-2006, 12:19 PM
  5. "Count" and "Countif" in Reports
    By JMantei in forum Reports
    Replies: 1
    Last Post: 06-20-2006, 02:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums