Solved

Forms & Data

Posted on 2007-11-16
6
161 Views
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!

Lee
0
Comment
Question by:lfaulkneruk
  • 3
  • 3
6 Comments
 
LVL 27

Accepted Solution

by:
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"

0
 

Author Comment

by:lfaulkneruk
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.

Lee
0
 

Author Comment

by:lfaulkneruk
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?

Lee
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 27

Expert Comment

by:VBRocks
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.  



0
 
LVL 27

Expert Comment

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

0
 

Author Comment

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

Lee
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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