Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Form question ah Excel Discussion (Misc queries) 1 November 5th 07 10:40 AM
User form question nath Excel Programming 1 May 20th 04 04:41 AM
User Form Question Ray Batig Excel Programming 2 January 17th 04 03:28 PM
User form question Haas[_2_] Excel Programming 4 November 27th 03 10:25 AM
User form question Gareth[_3_] Excel Programming 1 October 29th 03 06:07 PM


All times are GMT +1. The time now is 11:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"