05-13-2023 09:19 PM
Hi everyone,
I am trying to develop an interface with a combobox, an add button, an edit button, a save button and a delete button. The names that I have in an excel list (first column) should appear in the combobox, and the other information should appear in the string Indicator (Birthdate, phone and country).
Example of excel list : name Birthdate phone Country
George xxxxxx yyyyyyy UK
Rick xxxxxx yyyyyyy USA
Jhon xxxxxx yyyyyyy USA
If I click on the add button, it gives me the option to add a new name, birthday, phone and country. If I click on save, the list in excel is updated with the new fields. But if I select a name in the combobox, and click the delete button, that line should be deleted.
So far I know how to display the information in the string indicators, but I don't know how to link the names with the combobox and the other functions that I mentioned. Can someone help me please?
Solved! Go to Solution.
05-14-2023 10:05 AM
You can play around with the array functions. I have attached a simple demo with Add feature.
05-14-2023 12:01 PM
Use 2D Array with Names and its associated information.
During selection use 1D array Search for Selected Name and Fetch the matching index for other information(Birth Date,Name, Phone and Country)
05-14-2023 02:50 PM
@Mocte117 wrote:
So far I know how to display the information in the string indicators, but I don't know how to link the names with the combobox and the other functions that I mentioned. Can someone help me please?
If this "works", your "excel" file is NOT an EXCEL file, even if you give it an xlsx extension. What generated that file? 😄
Your loop also spins so fast that all you ever see is the last entry.
What should the various buttons do (for example should [ADD] add a new name that did not exist in the file? Should [delete] delete the current entry or all? What does the [edit] button do? etc. launch a popup with controls?)
As a first step, attach your code attempt and your data file containing tab delimited text. Explain every needed operation.
05-14-2023 03:32 PM
Personally, I would load the entries into a listbox and shift register, and update the data depending the desired action. Entering new data should use a popup. Have a look at this example. Should the entries be sorted by name?
05-14-2023 05:57 PM
Hi,
Thank you all for the responses.
I decided to use the Vi that ZYOng left me as a base, so I made modifications as you can see. I added a jump in the button add, so that instead of filling the data in the same VI, you can fill it in another VI.
----------------->
The actual problem is, when i click on ADD button, the data is not saved on excel.
Can someone see an error in my code?
05-14-2023 06:45 PM
Please attach your code. We cannot debug the screenshot.
05-14-2023 06:45 PM - edited 05-14-2023 07:28 PM
As you can see from the code, the add button just adds it to the data in the shift register. It gets saved to file once you press the stop button of the main loop. If you abort the VI, any data changes are irreversibly lost.
Even if you correctly stop the VI, you are not writing the header row, so the first data row will get clipped on the next read.
This is all extremely convoluted! I have a much simpler draft on another computer, so be patient. There is no need for globals and parallel loops!
05-14-2023 07:05 PM
The file.
05-14-2023 07:29 PM
See if this can give you some ideas.