X
XPS350
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.
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.