Text comes in wrong in Access form - ms-access

I have an inventory database. When I enter a description (24" Monitor) on a form it looks as it should. When I open another form with the description, it comes in as
<div>24&quot, Monitor</div>
Any ideas why this is happening and how to fix it?

In your Inventory Database the Description field is set as Memo field.
If you try to get the values from memo field into a plaintext than you will get the text as HTML Format as above.
To avoid any confusion make sure what you would like to achieve. Either set the Textbox TextFormat Property from plaintext to Richtext or Change the datatype of the Description field from longtext (Richtext) to longtext (Plaintext) or change to ShorT Text.

Related

Multiline property problems

I have a column in my database that is set to memo. I am trying to view the data in a textbox.
I have enabled new line in field from the Enter Key Behaviour property but all the data from the record is now showing - What am I missing?
The data is being pulled from a list box, example code below:
Textbox1 = listbox.column(1)
Thanks in advance
This has nothing to do with the EnterKeyBehavior property of the text box.
http://allenbrowne.com/ser-63.html
Row Source
A Memo field in the Row Source of a combo box or list box will
truncate.
Don't use memo fields in combos or list boxes.
You'll need a different method to load the text box, e.g. read the ID from the listbox and use DLookup().

Input Field with text already populated on page load

I have a custom Visual Force page that on load has a name field that is supposed to have {Auto} printed inside the input text box that the user can delete or leave or not. I have been using a html-placeholder however the text just disappears and is gray.
My VF inputfield:
<apex:inputfield required="true"
value="{!EventPackageRevenueBreakdown__c.Name}" html-placeholder="{!Auto}"></apex:inputfield>
What it looks like with that code:
What I need it to look like (notice the cursor is after the closing scope)
Thanks in advance I'm still very new to this!
I suggest you to set Name field in controller with '{Auto}' value.
The placeholder attribute will disappear when there is a value in the field, what you want is to actually set the VALUE of the field to {Auto}.
Try this:
If you want it to automatically clear the field if a user clicks into it, you could add some javascript to handle that.

Auto insert area code

I have a text box in Microsoft Access 2013 that corresponds to a telephone number. The text box has the input mask of:
!\(999") "000\-0000;;_
I am trying to auto insert the area code. For example, when a users goes to enter a telephone number, the area code is already populated into the text box. I have tried to set the default value in both the table design and on the property sheet of the text box but no luck. Its always aligned to the right. For example it looks like this:
If I add spaces to the default value on the text box property, the input mask is ignored and Microsoft Access generates an error stating:
The value you entered isn't appropriate for the input mask '!(999") "000-0000;;_' specified for this field.
I have contemplated modifying the table structure to include a specific field for an area code, but that is my last resort.
Is there a more efficient way to automatically populate the area code in the text box when a new record is generated?
You can write a function in VBA to do this. Something like;
Function FormatPhone(PhoneNumber As String) As String
FormatPhone = "(719)" & PhoneNumber
End Function
This function will take a string like '123-4567' and return '(719)123-4567'.
In the AfterUpdate event of your phone number field put;
[TextBoxControlName].Value = FormatPhone(Nz([TextBoxControlName].Value,""))
and this will add the formatted string to the text box.

Use table field description on form

I would like to display a field's description on a form. How would I accomplish this? For example, table name is tblbureau, field name is Counsel with a description 'General Counsel for the Defense', form name is frmCounsel. I'd like to use a control (textbox?) that displays the full description instead of using the default label for the field name. Thanks.
If you have used the form wizards to create the form, any descriptive text is added to the StatusBarText propery. This is even true when you create a blank form and drag fields from the field list to the form. You can refer to this property for your message box, or just refer the user to the statusbar. You can also update the ControlTipText property with the StatusBarText property.
MsgBox Me.ATextBox.StatusBarText
Using the above will save coding to get the description:
Currentdb.TableDefs("atablename").Fields("afieldname").Properties("Description")
Note that the description property is not available for fields when you have not added a descrition, so the above would cause an error.

How do I edit a text field in Selenium 2?

I can type text into a field using WebElement.sendKeys() but editing doesn't work: I can neither move the cursor nor delete the last character that I typed with e.sendKeys( Keys.BACK_SPACE )
How do I modify the value of a text field in Selenium 2 (WebDriver)?
You can definitely do that by either of the two methods. I have tried and it works.
e.click() # Positions the cursor at the end of the string
e.sendKeys(Keys.BACK_SPACE )
Or you could simply clear the text, and start over again:
e.clear()
e.sendKeys("What you want to send")
I found this solution that seems to work pretty well. It basically clicks on the text field WebElement, then sends Ctrl-End to put the cursor at the end of the text. Then sends the string that I had previously initialized.
(quickReplyTextArea is a text field WebElement that I have previous found, as is postQuickReplyButton (button instead of text field, obviously). replyText is a String that I initialized earlier)
quickReplyTextArea.click();
quickReplyTextArea.sendKeys(Keys.chord(Keys.CONTROL, Keys.END));
quickReplyTextArea.sendKeys(replyText);
postQuickReplyButton.click();
You can try clicking first into that text box, and use sendKeys() afterwards.