473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MyControl.text in form without record

BUX
If I try to read MyControl.text I receive Run-Time error 2185 that
means about < Impossible to refer to a property or a metod if the
control is not active >.

But this happen only if the form have no record and ALLOWADDITION is
set to FALSE.

Do you know in this case how can I get MyControl.text ?

thank you
Nov 13 '05 #1
6 3158
On Sun, 18 Sep 2005 05:30:10 GMT, BUX <pi***@pippo.it > wrote:
If I try to read MyControl.text I receive Run-Time error 2185 that
means about < Impossible to refer to a property or a metod if the
control is not active >.

But this happen only if the form have no record and ALLOWADDITION is
set to FALSE.

Do you know in this case how can I get MyControl.text ?


Will MyControl.value do what you want?

mike
Nov 13 '05 #2
In pure VB, where the Text property of a control is the default property, so
VB people often get confused about this when they come to Access. In Access,
you usually want to refer to the Value of a control rather than its Text
property. Text applies only to the edits in process in a control that has
focus.

If the form does not allow additions, and has no records, the Detail section
goes completely blank. No control has focus, so you cannot use the Text
property. In fact, the controls don't exist in the Detail section, and so
you cannot refer to their Value property either. To avoid the error, you
would need to explicitly test for reccords first, e.g.:
If Me.RecordsetClo ne.RecordCount > 0 Then
If Me.MyControl.Va lue = 999 Then ...

If the form has no records and new records cannot be added, but your control
is in the Form Header or Form Footer section, you can see the control, and
it can take focus, so you would expect to be able to refer to its Value or
Text property. But if you attempt it, there are known bugs in all versions
of Access that give unreliable results. For a description and sample, see:
Incorrect display of data
at:
http://allenbrowne.com/bug-06.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"BUX" <pi***@pippo.it > wrote in message
news:2f******** *************** *********@4ax.c om...
If I try to read MyControl.text I receive Run-Time error 2185 that
means about < Impossible to refer to a property or a metod if the
control is not active >.

But this happen only if the form have no record and ALLOWADDITION is
set to FALSE.

Do you know in this case how can I get MyControl.text ?

thank you

Nov 13 '05 #3
BUX
No, MyControl.Value can not do what I want.

MyControl is in Header section and I use it to filter the form.
I set MyForm.AllowAdd ition = True until the bug will be resolved.

Thank you very much.

Bux
On Sun, 18 Sep 2005 05:30:10 GMT, BUX <pi***@pippo.it > wrote:
If I try to read MyControl.text I receive Run-Time error 2185 that
means about < Impossible to refer to a property or a metod if the
control is not active >.

But this happen only if the form have no record and ALLOWADDITION is
set to FALSE.

Do you know in this case how can I get MyControl.text ?


Will MyControl.value do what you want?

mike


Nov 13 '05 #4
Don't hold your breath waiting for this bug to be fixed. This bug has been
in Access fore more than 10 years, so I doubt you will get Microsoft to fix
it.

Your workaround of setting AllowAdditions to True is probably the best
option you have. You can cancel the form's BeforeInsert event to prevent new
entries.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"BUX" <pi***@pippo.it > wrote in message
news:8d******** *************** *********@4ax.c om...
No, MyControl.Value can not do what I want.

MyControl is in Header section and I use it to filter the form.
I set MyForm.AllowAdd ition = True until the bug will be resolved.

Thank you very much.

Bux
On Sun, 18 Sep 2005 05:30:10 GMT, BUX <pi***@pippo.it > wrote:
If I try to read MyControl.text I receive Run-Time error 2185 that
means about < Impossible to refer to a property or a metod if the
control is not active >.

But this happen only if the form have no record and ALLOWADDITION is
set to FALSE.

Do you know in this case how can I get MyControl.text ?


Will MyControl.value do what you want?

mike

Nov 13 '05 #5
BUX


It is incredible: a never have think possible that can exist a bug ten
years old!

On Mon, 19 Sep 2005 20:16:23 +0800, "Allen Browne"
<Al*********@Se eSig.Invalid> wrote:
Don't hold your breath waiting for this bug to be fixed. This bug has been
in Access fore more than 10 years, so I doubt you will get Microsoft to fix
it.

Your workaround of setting AllowAdditions to True is probably the best
option you have. You can cancel the form's BeforeInsert event to prevent new
entries.


Nov 13 '05 #6
Here's another 10 that have been around for 5 years or more:
http://allenbrowne.com/tips.html#flaws

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"BUX" <pi***@pippo.it > wrote in message
news:1l******** *************** *********@4ax.c om...


It is incredible: a never have think possible that can exist a bug ten
years old!

On Mon, 19 Sep 2005 20:16:23 +0800, "Allen Browne"
<Al*********@Se eSig.Invalid> wrote:
Don't hold your breath waiting for this bug to be fixed. This bug has been
in Access fore more than 10 years, so I doubt you will get Microsoft to
fix
it.

Your workaround of setting AllowAdditions to True is probably the best
option you have. You can cancel the form's BeforeInsert event to prevent
new
entries.

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3394
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get sized strangely using the .RTFHeight property of the control. Specifically, lines of text get cut off the bottom of the control when I use the code...
8
18327
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". The values in the dropdown are loaded in the correct order, but the initial value is not the first row of the dropdown as I expected. The field...
3
2115
by: MS | last post by:
What's the best way to "store" and display a value in a text box that changes from day to day. An example of this would be where the name of the user is manually typed in after using the datbase, along with (say) the date. ATM, I have a table with (say) 4 fields. Each field is linked to a column in a combo box. The combo box is invisible on...
11
4605
by: bala | last post by:
hi!!! i need to display a disclaimer which is two page in length in a word document. i also need to format the text. the idea is something as follows on opening the application, a form which serves as splash screen with the disclaimer of the application is shown. now the problem i am running into is in the display of the disclaimer which...
6
2129
by: allyn44 | last post by:
HI--what I am trying to do is 2 things: 1. Open a form in either data entry mode or edit mode depending on what task the user is performing 2. Cancel events tied to fields on the form if I am in edit mode. The reason I want to do this is becasue when entering a new record the form is entered in data entry mode and I have lots of stuff...
12
12914
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can we prevent this from happening? Thanks. ming
10
9543
by: lorirobn | last post by:
Hi, I have a form with several combo boxes, continuous form format, with record source a query off an Item Table. The fields are Category, Subcategory, and Color. I am displaying descriptions, not ID's, so I have to convert the ID's from various lookup tables. The combo boxes work fine except for subcategory, which is dependent on...
3
11939
by: Zeeshan7 | last post by:
We can have an unbound text box on the form in which the person can type in the text box they want to go to retrieve information without having to use the find record button or menu option. For this we can use the After Update event to move to the desired record (please see below code). How can we hide or restrict other records to display in a...
2
3639
by: Denise | last post by:
Front end is Access 2002, back end is linked Oracle tables. My users need to describe things in feet and inches and want to use the standard ' and " abbrevations. On a testing form I go to a record with double or single quotes in the location description and click a button to see if Access can tell me the ID number and find its way back to...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.