How to create dynamically multiple command button in vb6.0,i have tried it with below code:

Dim WithEvents cmd1 As CommandButton

Set cmd1 = Controls.Add("VB.TextBox", "cmd1")
cmd1.Left = cmd1.Left + cmd1.Width + j
cmd1.Visible = True

but the problem is i want to create more than 1 command button on base of qry.
plase anybody can give me the answer