How would i make visual basick remember selections from other forms so it will excute the disired outcome at the end of my process.

Recommended Answers

All 4 Replies

You should be able just to reference those elements. Let's pretend you have form1, and form2. You have a button on form1, and a combobox on form2. In the code for the button on form1, you could do this msgbox form2.combo1.text , and it will gladly display the information in form2's combobox, with a click of a button on form1. If you are talking about something more complex, you may need to delve into using files, or registry entry's as a means to save your data for use from another app or something like that.

How would i make visual basick remember selections from other forms so it will excute the disired outcome at the end of my process.

It also depends on what you mean by 'process'. If you trying to create a wizard type application, save the form selections in variables for easy reference at the end of the process. If your 'process' spans multiple application instances then, as comatose said, you'll need to use files or what not. And you could use a database, but thats a whole different discussion. . . .

Plus a database would be a serious waste of database (and processing) power to handle a few values that need to be saved.

How would i make visual basick remember selections from other forms so it will excute the disired outcome at the end of my process.

if you want to call a variable in another form, you can also set the variable as public.
EX. Public CustomerID
you can also use module if you have lots of forms. To reduce the coding and space you can call all the function in each form in an object.

I hope you find these useful. happy programming

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.