What you can do is create a table that has a record number (autonumber), a button number (e.g. 1, 2, etc.), and a part number (e.g. 892).
On the form, number each button sequentially, e.g. cmdButton1, cmdButton2, etc.
On the form's ON OPEN event, you could do
Dim i as Byte
For i = 1 to 15
Me("cmdButton" & i).Caption = "Part No. " & DLookUp("[PartNo]", "NameOfTable", "[ButtonNo] = " & i)
Next i
But I have to ask why you have 15 buttons. Why not a combobox with the names of the parts listed with ONE button next to it? The user picks a part number from the combobox and then clicks the one button to get to that part.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|