Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tricky user form question
HI All,
I have an excel spreadsheet that is used as a tool to enter data into a heavily administered database. I have a user form that is built from the table within access that the data is eventually transferred to. How ever: The fields in this table are subject to change so the table builds based on what is in the table and the text boxes are labeled accordingly. I have done this and the code/form works fine. Now i need to have a macro called when the user enters one of these textboxes. For example, the code will create a text box and call it the same as the field in the access table where the data will eventually go, ie. txtDate_of_Birth, i need to work out how to put the txt_Date_of_Birth_Enter() code in, when the name of the text box may change. Can this be done. Nath |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tricky user form question
Yes, I think it can be done. Here's start:
Sub a() Dim LineNum As Integer With ThisWorkbook.VBProject.VBComponents("Userform1") .Designer.Controls.Add "Forms.TextBox.1", "MyTB" LineNum = .CodeModule.CreateEventProc("Enter", "MyTB") .CodeModule.InsertLines LineNum + 1, "Beep" End With End Sub -- Jim Rech Excel MVP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User Form question | Excel Discussion (Misc queries) | |||
User form question | Excel Programming | |||
User Form Question | Excel Programming | |||
User form question | Excel Programming | |||
User form question | Excel Programming |