I have created an ODBC connection, and need to create a button for each record. Any ideas??
The amount of records varies drasticly form say 1 to 1000, so its not feasible to have buttons hidden.....
Thanks in advance,
--Don
Printable View
I have created an ODBC connection, and need to create a button for each record. Any ideas??
The amount of records varies drasticly form say 1 to 1000, so its not feasible to have buttons hidden.....
Thanks in advance,
--Don
just out of curiosity why do you need a button for every record?
I agree with PJB there must a more efficient way of doing this without the need of 1000 buttons !!
But if you want to know how to create buttons at runtime, here is how u can do this
Code:'Make a control array of a command button
'eg set the Property "Index" of Command1 to 0
'and paste the code
Dim iCount As Integer
Private Sub Command1_Click(Index As Integer)
Load Command1(iCount)
Command1(iCount).Visible = True
Command1(iCount).Left = Command1(iCount - 1).Left + Command1(iCount - 1).Width
iCount = iCount + 1
End Sub
Private Sub Form_Load()
iCount = 1
End Sub
Thank you sirs this is what I needed :-)
--Don