ouestque
asked on
Access: Help with code: Using CreateEventProc
I have attached a snippet of code. When I run it I get the following error:
"Run-Time Error '57017': Event Handler is invalid"
Will someone help me make the attached code work?
"Run-Time Error '57017': Event Handler is invalid"
Will someone help me make the attached code work?
DoCmd.OpenForm "SampleForm", acDesign
a = 0
b=0
Do
Set cmd = CreateControl(b, acCommandButton)
cmd.Name = "Custom " & a
cmd.Caption = "Customize " & a
cmd.OnClick = "[Event Procedure]"
InsertCode = Forms![SampleForm].Module.CreateEventProc("Click", cmd.Name)
b=b+1
a = a + 1
rst.MoveNext
count = count - 1
Loop While (count > 0)
DoCmd.Close acForm, "SampleForm", acSaveYes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
change ...
cmd.Name = "Custom " & a
to
cmd.Name = "Custom" & a
Steve