Solved

Forms & Data

Posted on 2007-11-16
6
163 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
[X]
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
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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