I have a form with few text boxes, combo boxes and label controls. I want to capture the caption of a label when it is clicked. The caption will be passed to a query which will create output on a different form.
I have tried Me.activecontrol.name but this seems to give the name of first text box and not the label which is clicked.
Please suggest.
A label cannot be active, so use the OnClick event of the label:
YourVariable = Me!YourLabel.Caption
Related
The label that I'd like to change the caption of has the name: "lblEventNameLabel"
The text box that holds the value that I want to update the label has the name "txtEventNameLabel"
The name of the report is "rptBookingConfirmation"
I've got as far as creating this Macro in the "On Load" part of the report:
SetProperty
Control Name lblEventNameLabel
Property Caption
Value [txtEventNameLabel]
When I open the report it updates the caption to "[txtEventNameLabel" instead of the value that is in the text box. I've also tried chaning the Value in SetProperty to [rptBookingConfirmation]![txtEventNameLabel] and [Reports]![rptBookingConfirmation]![txtEventNameLabel] but those have the same result.
Any help would be much appreciated!
Me.lblEventNameLabel.Caption = "Your Text"
I have an input field of type = "text". At the time of entering the details into the input, I can enter a long input. The value is getting stored appropriately in DB as well. After clicking on a submit button, I am disabling the field.
So input is still visible but with only the value (noneditable). The problem arises here as only the length of text box input is being displayed.
Is there any way in which the entire input will be displayed?
One way to do this is instead of disabling the input box, you just remove the onChange event on the inout field and style the text to look like its disabled. if onChange event is something like this:
onChange={() => ()}
It won't be able to change the value of the input field, as it has an anonymous function.
That's one of way of doing it.
How do I display the word <<required>> in the field of a required field and "choose a country" in the country field in an unbound form of an access fillable form.
Set the property Format of the textbox:
#,"<required>"
Replace comma with semicolon if that is your local separator.
The key here is whether you want "<>" and "choose a country" being the actual values of these controls.
I would add transparent background labels on top of the controls. Set the On Got Focus event of the underlying controls to make the corresponding label invisible and set the On Click event of the label to set the focus on the underlying control. You can also use the On Lost Focus event of the controls to see if you should turn the label visible again or not.
AKA, if I have two fields (one radio button group and one textarea that only appears if the "other" radio button is pressed) how would I make it so the input from the text area overrides the "other" button having it's value placed in the mailto?
E.g., I want this to happen:
field1=text from text area
NOT this:
field1=other
field2=text from text area
Could I set the value of the "other" radio button in field1 to the text coming from the text area?
Alternatively, could I do anything to prevent a certain field from appearing in the mailto fields?
In future, please ensure you present SO with a code issue, not a general question or request. However, you would use a JQuery change handler, like so:
$('#mastertextboxid').on('input', function(){ //executes every time master's text is updated
$('#slavetextboxid').value($('#mastertextboxid').text()); //updates the values
})
This will overwrite any text in the slave textbox when the master textbox is changed, but the User will still be able to input into the slave textbox. It's known as One way data binding.
I am looking for a way that I can create custom text on an HTML page dependent on user input from a submit form. I've looked at similar threads online but can't figure out how to do this on my own page.
Basically I have a text area with this default text "My name is and I want to give $10 to charity".
If I have a submit form button how do I get it to take the name entered from the form and then put that value in to the portion of the text?
Thanks
Andrew
This is probably what you are looking for:
http://jsfiddle.net/NbuF6/2/
Basically, you have a textarea (id: final-text) and an input (id: name). The button (this can be changed to the form's onsubmit function if you want to) calls the following JavaScript function to fill the textarea:
function fill_textarea() {
document.getElementById('final-text').value = 'My name is ' + document.getElementById('name').value + ' and I want to give $10 to charity';
}