Results 1 to 4 of 4
  1. #1
    jassie is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2012
    Posts
    40

    Newbie using access 2013 features

    Since I am new to Access, I have the following questions to when to use each of the following features in Access. I am basically replacing vb code with the same functions in access. Here are the questions:
    1. When should I use a module versus a form?
    2. When should I use query versus a macro?
    3. When would you combine any of the access features to complete a request? Like would I use a query inside of a form or Macro or a module?
    4. would I use a macro inside of a query, module, or form?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You are comparing apples and oranges.

    There is no 'module versus a form'. If you need a form to make tasks easier, then use a form. A form can have code (macro or VBA). Code behind form can call procedures in a general module.

    There is no 'query versus a macro'. A macro can call a query object.

    Queries can be used as the RecordSource of a form or report.

    Macros can call VBA functions.

    I don't use macros, only VBA.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    1. When should I use a module versus a form?
    Always use a form as a User Interface. If you need VBA, create code behind the form. The code behind will be private to the form. Public functions within a General Module will be public and global to the application. If you create a Class, that is not a form, you can instantiate the class from within another module/class and access its Public methods.

    3. When would you combine any of the access features to complete a request?
    Anytime and all of the above. I would argue against using macros, special data types, lookup fields, and navigation controls/forms unless there was a need to interact with SharePoint. Other than that, the sky is the limit, really. Use the features anywhere, anytime, and anyhow. Just keep your users limited to graphic interfaces via forms.

    4. would I use a macro inside of a query, module, or form?
    I don't typically use macros either. Macros do not always carry over from one version of Access to another. I do not think you can execute a macro from a Query Object and I cannot imagine when that would be desirable if you could. You can use VBA to call or execute a Macro Object.

  4. #4
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Hi Jassie,

    I'll try to explain as simply as I can. I've only been working in access for about a year now, so maybe my (still newbie) perspective could help you out.

    Quote Originally Posted by jassie View Post
    1. When should I use a module versus a form?
    For lack of my own definition of a module, I simply googled it and it gives a pretty straight forward definition of an "Access module" module is a collection of user-defined functions, subroutines, and global variables written in VBA code. These objects can then be used/called from anywhere in your Access database. I would say, don't worry about modules just yet.
    As for a form, forms are used for the end users(the people that will be using your database) to retrieve/edit/view the data in the database. The form will usually contain a record source, which is typically SQL(structured query language), these SQL statements are what "retrieves" the data from your tables. The SQL statements make up a query.

    Quote Originally Posted by jassie View Post
    2. When should I use query versus a macro?
    I described what a query is above. A macro is a tool that allows you to automate tasks and add functionality to your forms, reports, and controls. For example: If you have, lets say, Form1, and you place a button on Form1. You can add a macro to that button to open up Form2. The "Button Wizard" really makes this a simple task.

    Quote Originally Posted by jassie View Post
    3. When would you combine any of the access features to complete a request? Like would I use a query inside of a form or Macro or a module?
    If we piece together the information I've given you so far... we have a form, which contains a query(SQL), which retrieves the data. On the form you can have buttons that contain macros to do simple commands like opening up another form, or running a specified query, or closing the form, or opening a report. These are all simple examples of a what a macro can do for you.

    Quote Originally Posted by jassie View Post
    4. would I use a macro inside of a query, module, or form?
    I think I have answered this question in question 3.


    I hope this will be of help to you Jassie. Please feel free to post more questions!
    About a year ago I was in the same position you are, I had no idea what a form, query, or macro was!


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

Similar Threads

  1. Export From Access 2013 To Excel 2013
    By Esmatullaharifi in forum Programming
    Replies: 8
    Last Post: 04-17-2015, 09:40 PM
  2. Outlook 2013 + Access 2013 + HTML
    By Yann63 in forum Programming
    Replies: 2
    Last Post: 11-26-2013, 02:39 PM
  3. Features removed from 2013?!
    By jmhultin in forum Access
    Replies: 2
    Last Post: 03-11-2013, 11:13 AM
  4. Access 2007 Security Features
    By crayola b in forum Access
    Replies: 1
    Last Post: 10-10-2012, 12:17 PM
  5. Removing access features
    By GraemeG in forum Programming
    Replies: 1
    Last Post: 03-10-2011, 11:12 AM

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