problem with interation between database and application
Hi every body
I have written the code (in form 1) for an application which is a coffee vending machine. There are 5 warm drinks among which you ca choose and pay for with 4 kinds of coin. This application works fine. There is also a database for the application which has been coded in another form (form 2). There are 5 records in this database which are the same drinks in the application. By the database, you have the possibility to add, delete, edit the records and update them. All of this works great just inside the database. But: every change in the database in form 2 should be applied and transferred to the main application in form 1 ( to coffee vending machine). I have established the connection between the database and the application by:
Private Sub UpdateControls()
which exists in for 2 and will be called by update button. Considering all of this above, my problems are: (I have attached all of the files including the forms and the database in a zip file so that you can have a closer look at. see also some translations the words below.)
1) whenever I edit the name a record in the database and update it, I expect that the inside-application caption of the same name as the record should be edited correctly. But instead, everything gets into a mess in the captions of of the drink buttons. When I try to edit once more, things get even worse.
2) If I edit the name of a record, the order of the cations in the application changes alphabetically, while the prices below them remain fixed. So, the names of the drinks go to the wrong prices. The wanted form is that the price should be sticked to the same button all of the time.
3) I don't really know how to connect every drink button and its properties to a certain record in the database, so that all of the time the recognize each other after editing, deleting and ... .
4) when I close the application after editing something, and start again (all in VB), I see that the name of the captions of the drinks in the application have returned to the pre-edition situation, while the changes in the database are remained. I want the changes to be remained in the application too.
I am a newbie to Visual basic. I appreciate any help .Thank you.
I have attached all of the files including the forms and the database in a zip file so that you can have a closer look at.Some Transltions will help Dryck: drink, mynt: coin, betald: paid, växel: change)
Re: problem with interation between database and application
Your problem sounds more like a programming problem than a database problem. I suggest you post this question in the Classic VB forum. You'll probably have a better chance of getting your problem resolved there.
Good luck
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
Re: problem with interation between database and application
Hi,
I've added to your code and I think this is what you are trying to do.
You will need to see if you have msado15.dll installed on your machine
if not you will have to update to mdac2.6 from ms web site.
If you can read up about using control arrays more and the use of
variables and there uses. Hope this will help