Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Forms & Data

Posted on 2007-11-16
Last Modified: 2010-04-23
Hi Guys!

My second question as I said....

Right I have 2 databases (Locations & Tags), 3 Forms (Form1(Main Form), Form2(Locations Data Form), Form3(Tags Data Form)). On form 1 there are 35 buttons, the text from these buttons is read from the database Tags directly, if I update these tags on Form2 the information is inserted into the database as it should.  When the form closes and returns to the main form, the buttons are not updated because the form is only hidden while data is updated then shown again. I cant use Me.Close because this makes the program close. Is there a code that I can put into the save button on the Tags form so that It updates Form1 before it is re-shown something like Form1.reload (A guess!).

The other this is that each button is assigned to a file name and when its pressed it plays music depending on which file name it is located to. At the moment this information is read from the text boxes on form2 which means that every time I load the program I have to load form2 from form1 then hide it. The string that windows media player uses is...

Dim item As WMPLib.IWMPMedia = AxWindowsMediaPlayer1.newMedia(Form2.TextBox1.Text)

As you can see all it is doing is getting the text from the text box on form2. Is there a way I can get the form to load this information from the database. Something like...

Dim item As WMPLib.IWMPMedia = AxWindowsMediaPlayer1.newMedia(LocationsDataSet.Locations.Cue1)

Then it would be accessing Locations table and Cue1 column?

Your help would be very much appreciated!

Question by:lfaulkneruk
  • 3
  • 3
LVL 27

Accepted Solution

VBRocks earned 500 total points
ID: 20298775
If you change the following property, you will be able to use Me.Close without closing the program,
(This is for VB 2005):

Go to the Properties Menu | < Project Name > Properties | Applicaton Tab
Then look for the drop down list that says "Shutdown mode:" and select "When last form closes"


Author Comment

ID: 20298913
Hi Guys,

Thanks for that suggestion VBRocks. I have however tried this and for some strange reason if I close form1 then open form3, update the data then show form1 and close form3 the information on form1 is the same as before I updated. i.e. form1 has not apated to the changes.


Author Comment

ID: 20298951
Apologies, I fixed that problem. The database connection was remaining open and form1 could not read the database.

Any ideas on reading the location of a file in for the WMP string?

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 27

Expert Comment

ID: 20298958
Well, are you completely closing form1 and disposing of the object, or are you just "hiding" it and
then "showing" it.  If you completely close form1, successfully update the database with form3,
and then create a new instance of form1, query the database for it's data when you load it, then
show it, it should display updated data.  If it's not displaying updated data, then either you are not
fully closing form1, and reloading it when it opens again, or you are not successfully updating your
data with form3.  

LVL 27

Expert Comment

ID: 20298966
No ideas on the WMP string, sorry.


Author Comment

ID: 20299028
Thanks VBRocks ill put the question out for the WMP string in a different question.


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question