Using "tiles"

Discussion in 'Access Forms Coding' started by XPS350, Feb 25, 2013.

  1. XPS350

    XPS350 Guest

    I am trying to build a form with “tiles” (like in Windows 8, Android orIOS). The number of tiles will be variable but limited and depends on selected data.
    My idea is te create a form with a number of buttons (Knop1 to KnopN), which will initially be invisible. Depending on the number of data selected some of the buttons will be made visible. So far I have the code below to makethe buttons visible and assign a text to each button.

    Dim rs As Recordset
    Dim Knop As String
    Dim Tel As Byte

    Set rs = CurrentDb.OpenRecordset("SELECT * FROM MyTable")
    Tel = 0

    While Not rs.EOF
    Tel = Tel + 1
    Knop = "Knop" & Tel

    With Forms("Formulier1").Controls(Knop)
    .OnClick = "[Event Procedure]"
    .Caption = rs!MyValue
    .Visible = True
    End With

    rs.MoveNext
    Wend

    My problem now is to create an event procedure for a button. The procedure could be for opening a new form based on a value found in the recordset. Sosomething like:
    DoCmd.OpenForm "NextForm", , , , , , rs!Myvalue

    Any help will be appreciated.
     
    XPS350, Feb 25, 2013
    #1
    1. Advertisements

  2. XPS350

    LightByrd Guest

    "XPS350" <> wrote in message
    news:...
    > I am trying to build a form with “tiles” (like in Windows 8, Android or
    > IOS). The number of tiles will be variable but limited and depends on
    > selected data.
    > My idea is te create a form with a number of buttons (Knop1 to KnopN),
    > which will initially be invisible. Depending on the number of data
    > selected some of the buttons will be made visible. So far I have the code
    > below to make the buttons visible and assign a text to each button.
    >
    > Dim rs As Recordset
    > Dim Knop As String
    > Dim Tel As Byte
    >
    > Set rs = CurrentDb.OpenRecordset("SELECT * FROM MyTable")
    > Tel = 0
    >
    > While Not rs.EOF
    > Tel = Tel + 1
    > Knop = "Knop" & Tel
    >
    > With Forms("Formulier1").Controls(Knop)
    > .OnClick = "[Event Procedure]"
    > .Caption = rs!MyValue
    > .Visible = True
    > End With
    >
    > rs.MoveNext
    > Wend
    >
    > My problem now is to create an event procedure for a button. The procedure
    > could be for opening a new form based on a value found in the recordset.
    > So something like:
    > DoCmd.OpenForm "NextForm", , , , , , rs!Myvalue
    >
    > Any help will be appreciated.
    >


    Don't know how much help this is but buttons have an on_click event.
    From there you could create a macro or a VBA code procedure.


    --
    Best Wishes,
    Richard Harison
     
    LightByrd, Feb 25, 2013
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grant

    Using a combo box to pass information to query

    Grant, Jul 2, 2003, in forum: Access Forms Coding
    Replies:
    4
    Views:
    92
    Marshall Barton
    Jul 2, 2003
  2. bcc

    Transactions using a form

    bcc, Jul 2, 2003, in forum: Access Forms Coding
    Replies:
    2
    Views:
    158
    Wayne Morgan
    Jul 3, 2003
  3. iamdriver

    Problems using HTMLHelp inside Access 2000

    iamdriver, Jul 4, 2003, in forum: Access Forms Coding
    Replies:
    0
    Views:
    98
    iamdriver
    Jul 4, 2003
  4. Mota
    Replies:
    3
    Views:
    131
    Marshall Barton
    Jul 4, 2003
  5. RC
    Replies:
    6
    Views:
    181
  6. Chris Freeman
    Replies:
    2
    Views:
    84
  7. Avid Fan

    Dialing numbers using internal modem using vba.

    Avid Fan, Mar 20, 2010, in forum: Access Forms Coding
    Replies:
    4
    Views:
    171
    Avid Fan
    Mar 21, 2010
  8. Maracay

    Using textbox using a variable

    Maracay, May 17, 2010, in forum: Access Forms Coding
    Replies:
    0
    Views:
    97
    Maracay
    May 17, 2010
Loading...