Upadate text in text box using Microsoft Visual Studio 2010 - vb.net

i want to set text as default on text box and it will be update for each starting after that using vb.net 2010. as example, i need to process out progress for a stock.the default value of stock is 30, so at the first log in, value text box will show 30 as the number, user will run out process (default number - out number = result), result will be show. then if user login for next time, it will update the number as result number at the first process.

Use the (ApplicationSettings) node in the Properties window to create a setting and bind it to the Text property of the TextBox. That way, value in the control will be saved to the user config file at shutdown and loaded at startup automatically.

Related

How to write correct field criteria to get rid of the 'enter parameter value' erro?

PICTURE OF QUERY :
I'm plotting graphs for 10 machines (machine 1, machine 2,...) performance -
average vs date graph.
User shall select the machine from a combobox (i made the values obtained from query, or should I make it from the table?) and set it to contain unique values only.
After selecting the machine, user shall click OK button. and a graph of the selected machine should be displayed in a new form.
Problem is, every time I click OK, it prompts me with the ENTER PARAMETER VALUE Forms!ViewReport!Combo9.
After I enter "machine 1" in the ENTER PARAMETER VALUE, it displays the graph correctly. I am expecting the graph to be displayed directly without the error.
The dialog appears because the query has no access to the field Combo9. Probably your form is not open or ViewReport is a subform, in this case, the reference to Combo9 should be different. Check, for instance, this giude for controls references.
But the most reliable method is to create a public function in the standard module, which should return the value from the desired form's field. It can check if the form is open and return the default value if the form is not available or the value is not selected. This function can be used in queries as criteria or in calculated fields.

Dirty on command?

I have an Access 2010 application that has a form with a text box and a command button on it. Clicking the command button places a default value in the text box.
Question: When a user clicks the command button I can either:
Run an SQL update to save the new text box value in the data source that it is bound to plus set the me.textbox1.value to its new value, or
Run the same SQL update to save the new text box value in the data source that it is bound to plus do a form.requery?
Which is better? Would changing the bound value in the data source initiate a current event and an automatic requery?
Thanks in advance.
If you want to save the entry immediately, I would write the value to the text box, and do
Me.Dirty = False
to save the record in the bound form.
I see no point in doing this via SQL.
Would changing the bound value in the data source initiate a current event and an automatic requery?
No, that would actually be the worst method. The form wouldn't know about the changed data source, and once the user would start editing, he would get the "Write Conflict" message.
Your 1. would have the same problem.

Go to the Beginning of String in "System.Windows.Forms.TextBox" - VB.Net

I have an application written in VB.Net where I call a dialog window that lets a user select a file or folder to copy. In that window I have text pre-populated in the file name field as an informational type of message to the user. However the text is so long that it only shows the last bit of it, so I need a way to reset the cursor position to the first character in the string. I also have the text highlighted by default so that the user can just begin typing to overwrite it. Here's what I have so far-
pushLocationBox1.SelectAll()
cursorPosition = pushLocationBox1.SelectionStart
I think the "cursorPosition = pushLocationBox1.SelectionStart" is a good start at getting the location I need to point the cursor to, but I'm not sure where to go from there.
Thanks in advance.

Visual Basic read, split, modify .txt file

I'm using visual basic 2010 and im a new user. I have my project called mini database.
I want to export and display my text file in my program.
05655606515|Working|John
12345456445|Working|Alex
42348564041|Not Working|Jean
I have my 3 columns table and i want an unlimited rows. The rows and depends on how many lines are there in the text file.
The first column a text box, which i can modify what i like to enter on it.
The second column is a combo box which i can select if it is working or not.
And the third column is also a textbox which i can type the name of a user.
Please help me to have my project. Thank you stackoverflow!
Make a form with a textbox, combo box, and a second textbox.
Add a command button to save the data, one to show data, and possibly one to cancel and one to exit.
Fill the combobox with the appropriate items.
In the click handler for the save button, write the data to a file with "append".
The show data button can read the file display the text in a multiline text box or rich text box.

VB.NET Modifying Microsoft Report Textbox Text at runtime

I want to create a Microsoft report in which should contain only one text-box and the text will be able to modify...
I have added a report WITHOUT using wizard. and have only one text-box on the report in the body section...
I wish to edit the text at run time but
me.reportviewer1.controls("textbox1").text= myrequiredtext
doesnt work...
I also tried
me.reportviewer1.controls("body").controls("textbox1").text = myrequiredtext
still doesnt work...