|
-
Dec 5th, 2000, 07:26 AM
#1
Thread Starter
Lively Member
Hello,
I've an application, which set several controls on the form at runtime.
Now I want to put the value of the controls into a recordset. The problem is that I don't now what sort of control I'm retrieving the data from.
For instance:
With a simple textbox you can retrieve the data by object.TEXT,
but with a checkbox for instance it is object.VALUE
How can I get the type of the control, which contains the data?
Thanks
-
Dec 5th, 2000, 07:58 AM
#2
Junior Member
I had the same problem.
You can use :
Select Case TypeName(Screen.ActiveForm.Controls(X))
Case "TextBox", "MaskEdBox"
' your code
Case "CheckBox"
' your code
End Select
-
Dec 5th, 2000, 08:45 AM
#3
Frenzied Member
Also check out TypeOf
Code:
Private Sub CheckControl(ctrl As Control)
Dim ctrl As Control
Msgbox TypeOf ctrl Is CheckBox
Msgbox TypeOf ctrl Is TextBox
End Sub
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Dec 5th, 2000, 09:42 AM
#4
Thread Starter
Lively Member
Hey JOP, thanks for helping me out.
I found the code must easier then that from iring
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|