473,606 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change form property using SetValue

Hey,

I am using SetValue to change the DataEntry property of a form to
"YES". But It doesn't work. No error messages, but the property didn't
change.Followin g is the what I am writing
SetValue:
Item: [Forms]![SubHistory]![Form].DataEntry
Expression:Yes

Does anyone know what is wrong? Thanks.

Mindy

Dec 6 '05 #1
6 12081
Is SubHistory a subform?

If so, you will need to get at it through the main form, e.g.:
Forms!YourMainF orm!SubHistory. Form.DataEntry

If not, drop the .Form bit:
Forms!SubHistor y.DataEntry

If the record is dirty, you may need to save the record first.

--
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.

"Mindy" <ma************ @yahoo.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .

I am using SetValue to change the DataEntry property of a form to
"YES". But It doesn't work. No error messages, but the property didn't
change.Followin g is the what I am writing
SetValue:
Item: [Forms]![SubHistory]![Form].DataEntry
Expression:Yes

Does anyone know what is wrong? Thanks.

Mindy

Dec 6 '05 #2
Allen,

SubHistory is a subform and I try the one you suggested for subform,
and here is the error message I get when I run forms:

The object you referenced in the visual basic procedure as an OLE
object isn't an OLE object.

Do you have any idea of this? Thanks.

Mindy

Allen Browne wrote:
Is SubHistory a subform?

If so, you will need to get at it through the main form, e.g.:
Forms!YourMainF orm!SubHistory. Form.DataEntry

If not, drop the .Form bit:
Forms!SubHistor y.DataEntry

If the record is dirty, you may need to save the record first.

--
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.

"Mindy" <ma************ @yahoo.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .

I am using SetValue to change the DataEntry property of a form to
"YES". But It doesn't work. No error messages, but the property didn't
change.Followin g is the what I am writing
SetValue:
Item: [Forms]![SubHistory]![Form].DataEntry
Expression:Yes

Does anyone know what is wrong? Thanks.

Mindy


Dec 6 '05 #3
The message suggests that something has the wrong name.

You might open the main form in design view, right-click the subform, and
choose Properties? What is in its Name property? The Name of the subform
control may not be the same as the name of the form that is loaded into the
control (its SourceObject.)

What confuses me, though, is that you said you were using SetValue, so I
assume you are using a macro. Yet the error message refers to a visual basic
procedure. You may well have more than one problem here.

--
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.

"Mindy" <ma************ @yahoo.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Allen,

SubHistory is a subform and I try the one you suggested for subform,
and here is the error message I get when I run forms:

The object you referenced in the visual basic procedure as an OLE
object isn't an OLE object.

Do you have any idea of this? Thanks.

Mindy

Allen Browne wrote:
Is SubHistory a subform?

If so, you will need to get at it through the main form, e.g.:
Forms!YourMainF orm!SubHistory. Form.DataEntry

If not, drop the .Form bit:
Forms!SubHistor y.DataEntry

If the record is dirty, you may need to save the record first.

"Mindy" <ma************ @yahoo.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
>
> I am using SetValue to change the DataEntry property of a form to
> "YES". But It doesn't work. No error messages, but the property didn't
> change.Followin g is the what I am writing
> SetValue:
> Item: [Forms]![SubHistory]![Form].DataEntry
> Expression:Yes
>
> Does anyone know what is wrong? Thanks.
>
> Mindy

Dec 7 '05 #4
Sorry, I didn't explain it clearly. The forms!formname! controlname of
setvalue is for setting up value of a control. What I want here is
different.

when we chose a form property, we will see form/data/event/other/all,
and under "data" there is Record Source, Filter, ..., Allow Edit, ...,
what I want is after a user hit one button, the "Allow Edit" property
will be changed from "NO" to "YES."

Thanks.

Mindy

Dec 7 '05 #5
Okay, we are going to build this reference a step at a time.

1. Make sure this form is open.

2. Press Ctrl+G to open the Immediate window.

3. Enter:
? Forms![YourMainForm].Name
substituting the name of your main form in brackets.
When you press Enter, Access should show the name.

4. Once you have that working you can try to get the reference to the
subform. On a fresh line in the Immediate window, try:
? Forms![YourMainForm]![SubHistory].Form.Name
If that responds with SubHistory, the reference is correct.
If not, then the subform control is named something different.

5. Once that is working, try:
? Forms![YourMainForm]![SubHistory].Form.AllowEdit s
Access should respond with either True or False.

6. Once that is working, you can copy the expression (without the question
mark), and paste it into your macro below the SetValue action.

--
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.

"Mindy" <ma************ @yahoo.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
Sorry, I didn't explain it clearly. The forms!formname! controlname of
setvalue is for setting up value of a control. What I want here is
different.

when we chose a form property, we will see form/data/event/other/all,
and under "data" there is Record Source, Filter, ..., Allow Edit, ...,
what I want is after a user hit one button, the "Allow Edit" property
will be changed from "NO" to "YES."

Thanks.

Mindy

Dec 8 '05 #6
Thanks a lot. It's very helpful. And it works now. Mindy
Allen Browne wrote:
Okay, we are going to build this reference a step at a time.

1. Make sure this form is open.

2. Press Ctrl+G to open the Immediate window.

3. Enter:
? Forms![YourMainForm].Name
substituting the name of your main form in brackets.
When you press Enter, Access should show the name.

4. Once you have that working you can try to get the reference to the
subform. On a fresh line in the Immediate window, try:
? Forms![YourMainForm]![SubHistory].Form.Name
If that responds with SubHistory, the reference is correct.
If not, then the subform control is named something different.

5. Once that is working, try:
? Forms![YourMainForm]![SubHistory].Form.AllowEdit s
Access should respond with either True or False.

6. Once that is working, you can copy the expression (without the question
mark), and paste it into your macro below the SetValue action.

--
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.

"Mindy" <ma************ @yahoo.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
Sorry, I didn't explain it clearly. The forms!formname! controlname of
setvalue is for setting up value of a control. What I want here is
different.

when we chose a form property, we will see form/data/event/other/all,
and under "data" there is Record Source, Filter, ..., Allow Edit, ...,
what I want is after a user hit one button, the "Allow Edit" property
will be changed from "NO" to "YES."

Thanks.

Mindy


Dec 9 '05 #7

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

Similar topics

2
4184
by: Stephan Walter | last post by:
Hi, I'm hacking on a LISP interpreter in JS , and running into trouble with numbers and Number objects. This is what I have: var a = new Number(1); var b = a; document.writeln(a == b); // true
0
6466
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the report are based on the same View addressed in the Record Source of both as 'dbo.CLMain_vw'. The View resides in a SQL Server 2000 database. There are two different problems I am having with filtering: The first involves filtering in the form by date...
2
7599
by: Jason G | last post by:
** Any assistance you can provide would be greatly appreciated ** I have a main form with multiple sub-forms. On the main form, I have a checkbox that corresponds with each sub-form, and this checkbox will express the users desire to lock the ability to edit a corresponding sub-form. To do this, I figure that each checkbox will have : (1) the AfterUpdate property call a Macro or VB Module to execute the setting of the Allow Edits...
11
12746
by: Aaron Queenan | last post by:
Given the classes: class Class { public static implicit operator int(Class c) { return 0; } } class Holder
2
3366
by: Tor Inge Rislaa | last post by:
How to change row height in a DataGrid I have DataGrid that is filled with data from a table in a DataSet. The content of the cells is text of more than one line (as a note field). What I want is to set the height of the row based on the number of lines in it. The row height of each row in the table may be different from each other. Is there a way to do this?
21
1874
by: Simon Verona | last post by:
Hope somebody can help! I want to automatically be able to add code to the initialize routine on a Windows form when I add a custom control that I've written to a form. Specifically, I'm trying to data bind to a normal class. So I've extended the standard text box to include a field for object name and property name. I want to be able to add a line such as : controlname.DataBindings.Add("Text", objectName, "myPropertyName") I've...
5
6464
by: JimM | last post by:
how do you set property using Activator.CreateInstance? Dim ty As Type = Type.GetTypeFromProgID("Project1.Class1") Dim o As Object = System.Activator.CreateInstance(ty) Dim pi As PropertyInfo = ty.GetProperty("Test") Dim params() As Object = {1S}
2
3196
by: miben | last post by:
I need to set a variable returned by a readonly property in a class by another class. So the only way to set that value is from a specific class and function. Public Sub Main Dim setter As New GoingToSetYou Dim item As New ToBeSet setter.NewItem(item) Dim sValue As String = item.Value
2
1575
by: Leif K-Brooks | last post by:
Is it possible to create a class in C# which behaves like another object's property? Here's an example of what I want to be able to do, using made up syntax: class PropertyObject { private int value = 0; public static int operator get(PropertyObject p) { return p.value;
0
8015
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8094
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5966
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5465
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3930
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2448
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
0
1296
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.