473,487 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I can't set the enabled/disabled property for an element of a subform

2 New Member
I have a form (let's call it UserMain) with a subform (UserSub). The control that contains the UserSub form is UserSubControl.

I want to set a field called details in the subform to be disabled if it has data in it already, and enabled if it is blank.

When I try to write a macro to control the property, I wrote
[Forms].[UserMain].[UserSubControl].[Form].[details].enabled. the Macro recognizes that the field is blank or populated, but when it tries to execute the setproperty, it gives me an error that the control is misspelled or doesn't exist.

If I try with a VBA module, again the application can see if the field is blank or not, but gives me error 91 - Object variable or With block variable not set.

It's driving me crazy. Can anyone help?
Dec 27 '10 #1
3 1728
jimatqsi
1,271 Recognized Expert Top Contributor
Please show us the VBA code and tell where (what event) the code is invoked.

Jim
Jan 3 '11 #2
mrwebbo
2 New Member
Thank you for your reply. I think I found the problem. I was told that you can't set properties on fields in continuous forms, and that's what I had.

Again, thank you for your help.
Jan 4 '11 #3
OldBirdman
675 Contributor
You can set Enabled and a few other properties in Access 2002 & later (& maybe earlier). In Design view, choose the control UserSubControl, then on the Menu bar choose Format ...Conditional Formatting. This can allow you to set .Enabled to True if field is zero length field (""). Otherwise it will remain .Enabled=False, which you would set in design view.
Jan 4 '11 #4

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

Similar topics

3
5115
by: Kelly Domalik | last post by:
I would like to override the "disabled" property of a hidden field. When disabled is set to "true", it would call a function to disable 2 other text fields on the form. When disabled is set to...
1
2568
by: jcazmail-groups | last post by:
The following snippet gives me an error on the line regarding AllowAdditions = False: Private Sub EditLocked() txtDeliveryDate.Locked = True cmdDeliveryDate.Enabled = False...
27
1822
by: Just Me | last post by:
I made a Usercontrol that must have AutoScroll set to true when it is used. So I set it to True in the Load event. However the property still shows in the properties window when the control is...
4
2406
by: Mel | last post by:
how can i change disabled background on all form elements ?
0
1110
by: Just D. | last post by:
All, I created a tool to setup our web apps, it does almost everything now, but how can we change the property of one of the subdirectories? One of the subdirectories should be made Writeable. ...
6
1586
by: Ali | last post by:
Hello How can I change a property of a control from From2 but the control is in Form1. I wrote these code in Form2 but didnt work. Dim f as new form1 f.Textbox1.Text = "hello world"
8
1924
by: VK | last post by:
Can be multiple instances of element used as the root element? That's a curly way of asking, but I did not come up with a better sentence, sorry. What I mean is with a document like: <?xml...
2
3762
by: Risen | last post by:
hi,how can button's Text property support multiline in vb.net 2003? Thx.
4
1070
by: W03L | last post by:
Hi. I created a CLR windows forms application and can't find alignment property for listBox to make it auto align to a top. For other components like progressBar, richTextBox there is also no...
5
18657
by: Sep410 | last post by:
Hi all, Here is my code: Private Sub Command12_Click() Dim strSql As String strSql = "Delete from tbl_city where CityId=" & Val(Me!txtEmail.Text) & ";" Set cn =...
0
7137
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,...
0
5442
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,...
1
4874
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...
0
4565
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...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
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 ...
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.