|
-
Nov 25th, 1999, 01:16 AM
#4
PowerPoster
You would be using VBA because it's the language of MS Access (and Word 97 and Excel 97 etc). Before I got VB6 I used to use Access to write stuff, and beleive it or not I did use VB sites to get code. The majority of it is transferable, but VBA has some extra bits, and some bits taken off, so they are in effect the same langauge, just with slight modifications.
Anyway - the answer is this. You need to declare the controls as a variable of type Control. Replace what you typed with this code...I'm assuming you are using Access, I don't know about Word or Excel but for Access this works.
Dim stText As String
stText = txtFirstWestOne
Dim ctlFormControls As Control
For Each ctlFormControls In Me
If TypeOf ctlFormControls Is TextBox Then
If ctlFormControls = stText Then
MsgBox "Something"
End If
End If
Next
You cannot use the text property in VBA/Access, it doesn't support it unless the control has focus.
Regards,
------------------
- Chris
[email protected]
[This message has been edited by chrisjk (edited 11-25-1999).]
[This message has been edited by chrisjk (edited 11-25-1999).]
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
|