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


    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. Advertisements

  2. XPS350

    LightByrd Guest

    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.
    LightByrd, Feb 25, 2013
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.