Visual Basic read, split, modify .txt file - vb.net

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.

Related

Add a field value to text box

I have an Access Table named Count. It has one field named Anz and it has only 1 record. I want to Show this record in a TextBox on a form named overview. So in the design mode of the form inside the TextBox I use the code
[Count]![Anz]
but it Returns me #Name? error when I Switch back to form mode. Where am I going wrong?
You can use in Control Source of your unbound text box =Dlookup("[Anz]","[Count]")
Also you can bound your form to Count table and use for text box control source Anz

Adding multiple textboxes to a form in ms-access?

I would like to have a line on an Access user-form. Call it Item #1. I would like Item #1 to be a text box where the user can enter any type of information. So for example, say the user entered "Tutoring" and then next to this was an additional Textbox that allowed the user to enter the hours spent tutoring and the date in which the hours were logged.
What I would like is to have a button to allow the user to add a second line (or set of textboxes) when needed, or a third line, etc. Is this something that can be set up on the Access form? Does this need to be coded in VBA? Just looking for some tips to provide me some direction on the best approach.
"If the data should not be stored in a table, it' a bit more complicated. "
You would have to make the text boxes not visible when the form loads, and then make each text box visible on the After Update event of the previous box.

MS Access: text box value show #Name?

I have created a form and set the form's RecordSource to a query. Below is my query:
SELECT GeneralT.*, SalaryT.[Status]
FROM GeneralT INNER JOIN SalaryT ON GeneralT.Deposits = SalaryT.Deposits;
In the form I have 4 textboxes. In the first 3 textboxes I show value from GeneralT table and in fourth textbox I show SalaryT.[Status] value. But this fourth value doesn't show in the textbox rather it show #Name?.
If I open the query in datasheet view I can see all the value properly. I don't understand what is wrong here. Please help me to show the result properly in the form.
Displaying #Name? for a field says that field has a control source that does not match with the query linked to the form. Some things to check:
Make sure Status is a selection from one of the pre-existing options in the Control Source drop down combo box. Click on the combo box to make sure.
Double check to make sure it is a "Text Box" and not a custom
control.
Make sure there isn't another text box named Status
Try chaning the control source to just Status instead of SalaryT.[Status]. If the field name does not conflict with the naming of a field in GeneralT, the selected SalaryT.[Status] will actually be displayed named Status.

Show Data Grid View specified cell value in Textbox

I am a student programmer who is learning VB. I am trying to make a telephone book type project in VB (Windows Forms). In my project I am using an unbound Data Grid View control. Below the Data Grid View, I have some textboxes which will display the values of the selected row. On the form load event, my program accesses a file and populates the Data Grid View control with values from the file. This works perfectly, but the problem I get is when I use the code:
txtLast.Text = dgvMain.Rows.Item(0).Cells(0).Value
to populate the textbox called txtLast with the value at the specified cell, the textbox doesn't display the value. The program doesn't crash or hang, it simply won't display the value and when I try to edit the textbox, it acts as if the textbox is empty. I have tried using
txtLast.Text = dgvMain.Rows.Item(0).Cells(0).Value.ToString()
as well as trying to refresh my Data Grid View control and the textbox. Nothing has worked so far. When I use a breakpoint to see whether that line of code is executed, the autos window shows me that the line of code is executed and that it sees the value of the specified cell as "Smith". However, when I press F11 to step into the next line, the textbox.text property remains as "" instead of changing to "Smith".
Note: when I manually specify the text through the code (i.e. txtLast.Text = "Test") it will show that text. Also, this problem is not with just one textbox, it is with every textbox that I use (I have 5 textboxes showing various values from the specified row). The weird thing is that out of the 5 textboxes, one of them, the masked textbox which shows the phone number works perfectly with the same line of code. (note it is not a problem only affecting regular textboxes as I have tried using both regular textboxes and masked textboxes, both produce the same problem except for the phone textbox).
Also, I would prefer to keep the Data grid view unbound (not connected to a database) and the textboxes unbound (not connected to the data grid view as a data source) because while browsing the internet I have seen people suggesting to bind the textbox or data grid view, however I do not understand how to do so, and I believe that this can be done without binding to a data source.
Any help is appreciated in trying to figure out why the text doesn't change. Let me know if you need any other info or if part of my explanation is unclear.
Thanks!

Need to build a macro that will take value(table name/form name) from a textbox and open the related table/form in ACCESS

i want to create a starting form in ACCESS that will hold a Textbox and a button.If user input text(say form name/table name) and click the button,it will show the form/table.If the name is not correct it will show a message.I am new in access.please help me with the macro or other things.
Thanks in advance.
Create a table and put the choices.
Create a blank form in design view.
In this blank form add a text box and a button.
Right click the text box, then choose Change To Combo Box
View the Combo Box properties
From the combo box properties, go to Data Tab
Here, you will see Row Source. Click the drop down in the Row Source and select the table where you put your choices.
You can Limit users to choose only from the available choices by changing Limit to List from No to Yes.
If you will limit your users from the choices, better not to add the button.