What was the error message?but I got error message
What was the error message?
As the others have said, that property is not automatically created by Access. So, when you check for it, it may not be there yet. Just add an error handler to your code. If you get that error, then you know the setting is not set.
As the others have said, that property is not automatically created by Access. So, when you check for it, it may not be there yet. Just add an error handler to your code. If you get that error, then you know the setting is not set.
a string (txtbox) does not have a backcolor property....
With all due respect, using Resume Next does not really handle the error, does it?
With all due respect, using Resume Next does not really handle the error, does it?
When you get an error, you can check the error number and then react accordingly.
Just my 2 cents...
What's the question? @bastanu already said, since txtbox was declared as a Property, it doesn't have a member called BackColor.
Sorry, I do not understand can you give more hint please?What's the question? @bastanu already said, since txtbox was declared as a Property, it doesn't have a member called BackColor.
If you're trying to change the color of a textbox, then use Textbox or Control, instead of Property.
You have this in your code.Sorry, I do not understand can you give more hint please?
Dim txtbox As Property
Dim txtbox As Access.Textbox
or
Dim txtbox As Access.Control
Me.TextboxName.BackColor = vbRed
You have this in your code.
You can use either one of these instead.Code:Dim txtbox As Property
However, you'll have to Set it first before you can change the BackColor property.Code:Dim txtbox As Access.Textbox or Dim txtbox As Access.Control
Is this function behind a Form? If so, you don't even need the Dim statements. You should be able to simply use.
Code:Me.TextboxName.BackColor = vbRed
Now, what is your question? Why can't you use words? Just curious...
Now, what is your question? Why can't you use words? Just curious...
The error message says you haven't defined the variable strErrMsg, because you haven't defined it yet before you used it.