Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I just learned about adding controls to a userform through coding and it
seems very useful. However, i was wondering if it is possible to make the controls added use _change functions? For example, on my code i have a textbox added when a user clicks a button. I name the textbox "Scan2" I know i can access the data in the new textbox by using userform1.controls("Scan2") However, i need to use a function that evaluates each character entered into the box and wait's for a ctrl key (chr(10)) to be pressed. When pressed, it runs a different function. If i had hard coded the textbox, i would use Private Sub Scan2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = 17 Or KeyCode = 13 Then call searchdata() KeyCode = 0 End If End Sub any help would be great. oh, i tried doing private sub homer.controls("scan2")_keydown...etc.. but of course that didn't work. It's never that easy :) Dan Butler |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ActiveX Controls | Excel Discussion (Misc queries) | |||
Need Help Tabbing between controls | Excel Discussion (Misc queries) | |||
using gui controls | Excel Discussion (Misc queries) | |||
Volatile Macro for Adding Controls When Opening Workbook | Excel Discussion (Misc queries) | |||
ActiveX Controls vs Form Controls | Excel Discussion (Misc queries) |