What have you tried ? What are the command controls called, are they named in a sensible fashion to allow you to loop around them ?
DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
Please use the star below the post to say thanks if we have helped !
↓↓ It's down here ↓↓
Actually i don't know from where how to start ? i only created the table with the above fields and created a btn control then copy paste until they became 12 btn . Their names command0 , command1 , command2 .. etc.
You may get some ideas from this post (from ChrisO post) but it deals with advanced concepts.
If you look at the "Similar threads" at the bottom of the pages in this forum, you could review such posts for related info.
I think google may be your best resource to find examples and articles for table and database design, form design and modules.
Good luck.
Last edited by orange; 06-20-2018 at 12:19 PM.
Have a look at this:
The form_load event will copy the captions from the table to the buttons.
The captions are not permanent, so must be done via the form_load.
Works like charm thanks buddy , But i wonder if i added another record in table tblNames how can i automatically add a new button with the new caption i've added in the table ? Is it possible ? . even if the form must be closed then opened again ?
Much easier would be to have invisible buttons already existing on the form and make them visible with the form_load event if needed.
Design modification in a deployed db should be rare. Programmatically modifying design is possible but not advised. Why do you need a button for each record as opposed to combo or list box or just listing records in form?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
shod90,
If you need a setup to handle a changing number of "records", then some technique to identify the number of records, modify the form (some event) to add the requisite number of text boxes and populate with data from the record(s) as necessary.
The sample from ChrisO shown in post #4 shows some of the techniques involved. Other databases by ChrisO with class modules
may b available online.
If you have a fixed number of records, you can set up the textboxes in design mode with proper naming, then use form load event to assign some values to textbox properties as Davegri has demonstrated. However, adding or subtracting records will force a form design change.
OK, this version has 15 invisible buttons that become visible as the captions from tblNames are added, up to 15.
I added a SortOrder field to tblNames that will allow you to control the position of each caption in the button grid.
It works , Super .. Thank you