Solved

Forms & Data

Posted on 2007-11-16
6
157 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now