Robbie1974
New member
- Local time
- Today, 04:09
- Joined
- Mar 31, 2005
- Messages
- 8
I'm trying to populate the captions from the buttons on my form with names from my table.
I have a table captions with the field names.
I have a form with 30 buttons not visible. All have the same caption button0.
This is the code I have so far:
This updates all buttons with the same name.
How do I get it to update to the following:
For every record in the table make the button visible and update it's caption.
Do I have to work with do while? And how do I do that?
Any help, because I'm stuck?
I have a table captions with the field names.
I have a form with 30 buttons not visible. All have the same caption button0.
This is the code I have so far:
Code:
Dim DB As DAO.Database, rst As DAO.Recordset, ctl As Control
Set DB = CurrentDb
Set rst = DB.OpenRecordset("captions", dbOpenDynaset)
For Each ctl In Me.Controls
ctl.Caption = name
ctl.Visible = True
Next
Set rst = Nothing
Set DB = Nothing
This updates all buttons with the same name.
How do I get it to update to the following:
For every record in the table make the button visible and update it's caption.
Do I have to work with do while? And how do I do that?
Any help, because I'm stuck?