By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,806 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,806 IT Pros & Developers. It's quick & easy.

compile error invalid use of property

P: 4
Hi,
When I write code
txtFirstName.text=rstKrish("FirstName")
compiler highlighted .text and error describes method or data member not found.
Please help
Mar 14 '07 #1
Share this Question
Share on Google+
5 Replies


Expert 5K+
P: 8,434
When I write code
txtFirstName.text=rstKrish("FirstName")
compiler highlighted .text and error describes method or data member not found.
Please give us some context. for example...
  • What version of VB is this?
  • What is txtFirstName?
Assuming it's a textbox, is this code within the same form? If not, you probably need to use a syntax something like YourFormName.txtFirstName.Text to access this value.
Mar 14 '07 #2

100+
P: 1,646
You should continue your questions on the same thread rather than starting a new one each time your code doesn't work. I have closed the original thread and this is a link to it
Mar 14 '07 #3

P: 4
Please give us some context. for example...
  • What version of VB is this?
  • What is txtFirstName?
Assuming it's a textbox, is this code within the same form? If not, you probably need to use a syntax something like YourFormName.txtFirstName.Text to access this value.
I have used Visual Basic 6.0 and txtFirstName is textbox
Mar 15 '07 #4

vijaydiwakar
100+
P: 579
Hi,
When I write code
txtFirstName.text=rstKrish("FirstName")
compiler highlighted .text and error describes method or data member not found.
Please help
check first the column name of recordset is spelled correct then check it doen't contain any null value to avoid this use this code
txt.text=Rs0("FirstName") &""
try it
Mar 15 '07 #5

Expert 5K+
P: 8,434
check first the column name of recordset is spelled correct then check it doen't contain any null value to avoid this use this code
txt.text=Rs0("FirstName") &""
Or, as a first step in debugging, comment out the existing line and replace it with...
Expand|Select|Wrap|Line Numbers
  1. txtFirstName.text = "A"
This will determine for certain whether the problem lies with the database field or the textbox. My money would be on the latter.

If the textbox is the problem, then chances are it is simply out of scope. For example, your code might be on a different form, or in a code module rather than a form. If that's the case, then you need to identify the form that it lives on - see my earlier post for details.

On the other hand, are you certain it's a textbox? And not, for example, a label?
Mar 15 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.