Get selected text within an text item in Oracle forms - oracleforms

There is following scenario:
In Oracle Forms 10, there is a TextItem with text in it. User selects a part of the text using his mouse or keyboard and presses a forms button with trigger behind it.
How do I find the portion of the text selected by the user?
In VisualBasic, there is something like SelectionStart, SelectionEnd, SelectionText. What is the equivalent in forms? Is there any chance to do it with WebUtil?
Thanx

There are 3 built-ins in Oracle form for handling this sort of thing:
COPY_REGION
CUT_REGION
PASTE_REGION
They are all restricted built-ins, so you need to be choosy about which trigger you call them in. Refer to the documentation, it will tell you whether restricted built ins are allowed or not in that particular trigger.
They take no parameters, only operating on the currently selected item (see :system.cursor_item). So, the user is in "textfield1" and they select a certain portion of the data. You need to decide which trigger to issue COPY_REGION in (the easy one is KEY-NEXT-ITEM). For your example, when the user would then press the button to copy, your code would navigate to the intented TextItem and issue the PASTE_REGION built-in.

Related

How to make navigation bar search box wait until pressing enter in MS Access?

I inherited an Access database and the main form uses the search box in the Navigation bar to find clients. The search function executes the search after every character that is entered, which is very slow over our network. There is a 2-4 second delay between each character.
Is there a way to make the search box wait until pressing "enter" before it executes the search?
I probably could add a custom search dropdown box , but I would like to avoid changing the users current practice (and save myself work) if at all possible.
Well, you're not providing us with much information.
I assume your current search is executed using VBA, probably by using the OnChange event on the search box. Move that to the AfterUpdate event, and you'll be done.
If you are using the inbuilt search facility located down by the record selectors, you are out of luck. Its behavior is hard coded into the Access exe program.
If you build your own search function then you can control exactly how it behaves. A great example is available here; http://allenbrowne.com/ser-62.html

enable command button on form while in filterbyform mode

I'm trying to put a pair of command buttons onto a form to enable users to:
enter filter criteria, then
after they enter the criteria, apply the filter
The first is easy enough with "DoCmd.RunCommand acCmdFilterByForm"
The second would work with "DoCmd.RunCommand acCmdApplyFilterSort", except that I can't figure out how to activate my command button "cmdApplyFilter". The code "Me.cmdApplyFilter.Enabled = True" throws a runtime error.
I've looked at a lot of discussions, and it seems the only way to do this is by clicking on the ribbon or quick access toolbar. Does anyone know how to activate a command button on the form while in filter by form mode?
I'm pretty sure that what you're trying to achieve is not possible. The 'filter by form' view of the form looks to be a copy of your original form with only the input controls enabled to allow you to enter your filter criteria. If you think about it, it wouldn't make sense to allow full functionality. If you could activate buttons in this mode then you would theoretically be able to perform all sorts of actions that aren't appropriate in this context: add records, delete records, navigate through the records etc.
I suspect that the only way you will be able to get the functionality you want without using the ribbon bar buttons (what's wrong with the ribbon bar?) is to hand-roll your own filter form. Design a new form having controls to accept filter criteria and buttons to cancel or apply the filter. Sounds like a lot of hard work though to replicate functionality that's already built into Access out of the box.

Google Script: Using an input text box in a form that pulls items from the sheet and presents as options

I am currently developing a program in Google Script that works with Google Sheets. I've created a tab that serves as the UI and have multiple tabs for each data type to store the data.
When I first started, I originally reserved some cells on the UI tab that I used as the inputs for creating a parent-child relationship instance. To do this, I directly set validation on each of the cells and used the "List from a range" Criteria to provide the drop-down list to provide the options to select from.
Now, I am trying to move this input off of the cells in the UI tab and into the sidebar. I am now using HTML Service and am creating a form to handle this functionality. However, I can't figure out where to get started to provide the same drop-down functionality for each of the text inputs in the form as I had when I used the cell validation.
Does anyone know what syntax is used to do this?
Thank you,
Nicholas Kincaid
jQuery auto-complete combo-box is what will take care of this => jqueryui.com/resources/demos/autocomplete/combobox.html

Hyperlink control in Access App

I've created a hyperlink control on a form page in an Access 2013 App hosted in SharePoint 2013, and want the text to display the same text ("Print Timesheet") while the actual link itself varies based on the value of a field in the record. This is so that I can link to a separate application using a query string with the individual record ID, which gets the data directly from the azure database and formats it in order to be printed out.
I've tried a macro expression to create the link address that runs "on current" and sets the value of the hyperlink, and also tried a computed column in the table to create the link which I pass to the hyperlink control value. I've set the "Default Display Text" on the hyperlink control to "Print Timesheet" in both cases.
The problem I have is that whichever way I try it, changing the value on the fly like this overrides the default display text of the hyperlink so that it displays the address itself rather than the text I want to display.
Is there any way round this?
Thanks,
Duncan
I am not sure if you got your answers. I was randomly looking on internet and found your query.
I thought the thread Troubles with Hyperlink control in Access Web App forms may have your answer.
LILizEidsness replied on August 21, 2014See post history
.....
If you have to build a url field dynamically, the basic syntax is
displaytext#url#
so, in my dynamic field....
=Concat("Click here#/relative/path/on/my/sharepointsite/allitems.aspx&ID=",[ID],"#")
....
You could use a label on the form to represent the link. Have the Label.Caption property set to "Print Timesheet" and use the On Current event to set the Label.HyperlinkAddress property to whatever the address from the recordsource is.

ACCESS/VBA: How to create a ON/OFF type switch to allow record modification on a form?

I was using a combobox on my search form to select whether to consult or modify a record.
To make it more user friendly (IMO), I put a togglebutton on a form, which controls the .AllowEdits property of my form. This way you can easily switch from reading to writing.
However I run into a problem; once .AllowEdits is switched to false, the togglebutton is not clickable
anymore !
What are my options ?
You must use a command button instead. It will not get locked.
You will however run into similar problems with other controls like a combo box you would use for quick searching a record. If you have that problem, use the solution here to lock/unlock all your bound controls.