473,396 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Use VBA to open property view for a given control?

TheSmileyCoder
2,322 Expert Mod 2GB
Do anyone know how to write a function that would select a control, open the properties for that control, select the correct tab, and set focus to a specific property?

Example:
I call my (at this point imaginary function):
GoToControl("tb_Date","Format")
which should then set focus to tb_date (in design view) and open the properties sheet, and go to the Format Property.
Nov 1 '10 #1
7 2347
ADezii
8,834 Expert 8TB
Selecting a Control, Opening the Properties Window, and selecting a specific Property is the easy part. It appears that accessing a specific Tab is another matter all together since they are dynamic, the Tab that appears at the forefront of the Properties Dialog, apparently is the last Tab that was accessed.
Nov 1 '10 #2
TheSmileyCoder
2,322 Expert Mod 2GB
Hi Adezii and thank you for your answer.

How do you open the properties window from VBA and select a property?

Then I can hopefully build from there.
Nov 2 '10 #3
ADezii
8,834 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. Me![txtLastName].SetFocus               'Set Focus to the Control
  2.  
  3. DoCmd.RunCommand acCmdProperties        'Open Properties for the Control
  4.  
  5. 'Critical Step missing, CTRL+TAB will cycle through the Tabs, but the same
  6. 'Tab isn't always in the forefront, Hot Keys to access Tabs won't work, etc.
  7.  
  8. SendKeys "{DOWN 4}", True               'Scroll down to the 5th Property on Tab
  9.                                         '(only method that I am aware of for this)
Nov 2 '10 #4
TheSmileyCoder
2,322 Expert Mod 2GB
Thank you for what you have provided so far.

Do you (or anyone else) know of a way to get feedback on what current Tab/property IS selected?
Nov 11 '10 #5
ADezii
8,834 Expert 8TB
Do you (or anyone else) know of a way to get feedback on what current Tab/property IS selected?
Sorry, but I do not and that is the $1,000,000 question. It must be controlled internally by Access. What, may I ask, are you trying to accomplish? Perhaps there is an alternative solution to your dilemma.
Nov 11 '10 #6
TheSmileyCoder
2,322 Expert Mod 2GB
Im working on a form, where you can enter a word to search for, and it will then search queries, table definitions, modules and forms for that word. That part is working ok, so far, but I wanted to enhance it by making a go-to button, so that when the keyword was found in e.g. a controls rowsource, it could open that form in design view, select the control, and highlight the rowsource.
Nov 11 '10 #7
ADezii
8,834 Expert 8TB
Interesting idea, but until you can figure out how to manipulate the Propert Sheet Tabs and associated Properties for a given Control, will be very tough to implement. I'll still scout around for ideas, since this is so interesting. Take care, and if I come up with anything, you'll be the first to know.
Nov 11 '10 #8

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

Similar topics

1
by: Rea Peleg | last post by:
Hi everybody Can any one give an example for handling a tree view web control event, inside an asp.net application? I am able to build a tree view using this control on an asp.net web form (on...
8
by: Yasutaka Ito | last post by:
Hi, Is there a way to find to which control the current control is docked against? For example, let's say I have panel1 and panel2 docked to left within a form. The panel1 is the first one on...
1
by: Davef | last post by:
When I try to open design view in VS I get that error. Is there anyway around that? <td vAlign=bottom noWrap align=right background="<%= Application("AppPath") %>/images/BarGradient.gif" > -- ...
1
by: Bob | last post by:
Ok, I have a custom web control (a server control) and I want to set a property on this control equal to a constant that exists in my code behind. Is there a nice way to do this by putting code...
3
by: Marty McFly | last post by:
Hello, I have a control class that inherits from System.Web.UI.WebControls.Button. When I drag this control from the "My User Controls" tab in the toolbox onto the form, I want it to reflect the...
5
by: =?Utf-8?B?U2NhbmJveQ==?= | last post by:
Guyz, Whatever happened to the 'Index' property for a control, that used to be present in VB 3.0 / 4.0 / 5.0 / 6.0 and which now seems to be missing from VBE 2005? I need to be able to make 4...
0
by: doubts | last post by:
Hi, I have a query regarding reading Image Property for button from a XML file . I read XML files to Generate Screens using System.Windows.Forms.Controls .The XML file is read and properties...
1
by: imagirlgeek | last post by:
I sure hope someone else has seen this, because I'm about to go crazy! I am unable to open Property Sheets anywhere in any of my databases...even a brand new one. Right-click Properties brings...
2
by: saeed rezaei | last post by:
how i can write some property form mycontrol that's can be expend. when i use this cod : property MyProp as integer .... .... .... end property its only add one property to my control but...
0
by: Scott | last post by:
I have the following question: In ASP.NET, what is the name of the class and property where server control data is stored? the first thing that comes to mind is view state or control state or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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...

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.