Results 1 to 5 of 5

Thread: [RESOLVED] Creating Option buttons based off Table Values

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2011
    Posts
    65

    Resolved [RESOLVED] Creating Option buttons based off Table Values

    Hey everyone,

    I was wondering if it's possible to write VBA code to create option buttons based off of table values. For example.

    My table contains 1 column and it is a parent table.

    Activity
    --------
    Run
    Walk
    Jog
    Sprint

    Would it be possible to create option buttons automatically when I open a form based off of the values under Activity???

    Thank you!

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Creating Option buttons based off Table Values

    Would it be possible to create option buttons automatically when I open a form based off of the values under Activity???
    yes quite possible, but you would need to give thought as to how you will position them
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2011
    Posts
    65

    Re: Creating Option buttons based off Table Values

    Westconn,

    Sorry for the late reply.
    I guess positioning them in the correct location would be the second issues I'd come across. But how would I create an option button with code? I am familiar with looping through a table to name my option button just not creating one.

    Thank you.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Creating Option buttons based off Table Values

    vb Code:
    1. shtobject.Shapes.AddOLEObject ' requred parameters for type and position
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2011
    Posts
    65

    Re: Creating Option buttons based off Table Values

    Perfect, thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width