I made a userform that is connected to a table. It works by inserting the desired input and then it takes the first empty row and inserts the data into the desired columns. It has a couple of questions which you answer. Basic questionnaire really.
The code that I use to enter the users input into the table looks like this : Copy userform data to table VBA - Pastebin.com
Now I want to make another userform that allows for the user to edit the already inserted data that is stored in the table. The userform that I made looks identical only to the first one, only difference is that it has a combobox at the top of the userform. The combobox rowsource is the A column, so basically the answer to the first question in the userform. When the user has chosen an alternative from the combobox I want to import the rest of the data that is on the same row as the selected item. Here is where I'm having trouble since I'm a beginner at VBA and excel.
How do write a code that knows what row to import based on the choice in the combobox?
I have written code that inserts the data into the Textboxes in the userform that looks like this : Edit table with userform VBA - Pastebin.com
So yeah, having trouble with importing the data into the userform because I don't know how to locate what row the data is coming from.
Also an additional side question to this: Once the user has edited the info, and want to save. I want to just save over the old one, so on the same row. I know that this is done the same way as the original input method, but here I also need to know the rowsource of the data, can the rowsource be non private in the VBA editor?
Any pointers would be greatly appreciated. And I thank you if you took the time to read this.
Skitto
The code that I use to enter the users input into the table looks like this : Copy userform data to table VBA - Pastebin.com
Now I want to make another userform that allows for the user to edit the already inserted data that is stored in the table. The userform that I made looks identical only to the first one, only difference is that it has a combobox at the top of the userform. The combobox rowsource is the A column, so basically the answer to the first question in the userform. When the user has chosen an alternative from the combobox I want to import the rest of the data that is on the same row as the selected item. Here is where I'm having trouble since I'm a beginner at VBA and excel.
How do write a code that knows what row to import based on the choice in the combobox?
I have written code that inserts the data into the Textboxes in the userform that looks like this : Edit table with userform VBA - Pastebin.com
So yeah, having trouble with importing the data into the userform because I don't know how to locate what row the data is coming from.
Also an additional side question to this: Once the user has edited the info, and want to save. I want to just save over the old one, so on the same row. I know that this is done the same way as the original input method, but here I also need to know the rowsource of the data, can the rowsource be non private in the VBA editor?
Any pointers would be greatly appreciated. And I thank you if you took the time to read this.
Skitto