Results 1 to 4 of 4
  1. #1
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107

    Create form and controls using vba

    I created a database for a computer gaming center



    My customers are asking for a form that shows the PCs numbers, so that they click on a computer number to start a timer.
    I was thinking to add buttons to a form where each button represents a PC in the gaming center, but the customer should be able to relocate the buttons to make them placed like their real places in the gaming center

    Since the number of PCs changes from one gaming center to another, the buttons should be created programmatically by the customers. I read about the following two VBA commands : CreateForm and CreateControl, but unfortunately, not enough documentation found on google.

    My question is, If I give the customer an ACCDE file, Is it still possible to create forms and buttons and relocate them programmatically ?
    And what happens to these forms/controls when the database is closed. Will they be deleted and then created again every time the database in opened?
    This is really confusing, any help please?

  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,518
    You might play with Chris's drag and drop sample(s). It's not beginner stuff, but it can be adapted to do what you want.

    http://www.baldyweb.com/ChrisOSamples.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107
    Quote Originally Posted by pbaldy View Post
    You might play with Chris's drag and drop sample(s). It's not beginner stuff, but it can be adapted to do what you want.

    http://www.baldyweb.com/ChrisOSamples.htm
    Thank you very much, this is exactly what I was looking for.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help! I adapted it to an app and it worked very well for me.
    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. Replies: 4
    Last Post: 03-26-2020, 03:27 PM
  2. Replies: 11
    Last Post: 04-09-2016, 08:54 PM
  3. Replies: 8
    Last Post: 01-13-2015, 12:23 PM
  4. Using Tab controls within a form
    By crowegreg in forum Forms
    Replies: 2
    Last Post: 08-25-2011, 08:17 PM
  5. Controls within form
    By crowegreg in forum Forms
    Replies: 4
    Last Post: 05-31-2011, 08:39 AM

Tags for this Thread

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