473,789 Members | 3,013 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Save calculations

6 New Member
Hi! i am i trying to make o vb program and i have a big problem.
I have a combination of forms into i put some keywords and i transfer data from one form into an other (from text to text or from labels to texts). I have a command and when i press it, it makes all the work, all the calculations and completes all the tables i have to the forms. The problem is when i have finished i want to keep this calculations. i don't want to lose them and to make them from the begging. The program take the names of the soldiers of the army and put them to a table of tasks. I want to use this program weekly. Is there any solution? A save command?? Or i way to export the tables as it is designed to a word with a simply command??
I Hope to hear news soon. . .
Many thanks J.K.
Apr 2 '08 #1
10 1467
kadghar
1,295 Recognized Expert Top Contributor
I want to use this program weekly. Is there any solution? A save command?? Or i way to export the tables as it is designed to a word with a simply command??
I Hope to hear news soon. . .
Many thanks J.K.

The easier way to save progress is to save your variables in a text file, then read them when you load it.

If you promess you'll be honest, the text file can have variables as they are, but if not, you'd beter use some cryptography.

HTH
Apr 2 '08 #2
epp319
6 New Member
is there a code to load the variables automatically or i have to put them one by one from the beginning??

many thanks for your help
Apr 2 '08 #3
epp319
6 New Member
is there a code to load the variables automatically or i have to put them one by one from the beginning??

many thanks for your help
Apr 2 '08 #4
epp319
6 New Member
is there a code to load the variables automatically or i have to put them one by one from the beginning??

many thanks for your help
Apr 2 '08 #5
epp319
6 New Member
is there a code to load the variables automatically or i have to put them one by one from the beginning??

many thanks for your help
Apr 2 '08 #6
epp319
6 New Member
is there a code to load the variables automatically or i have to put them one by one from the beginning??

many thanks for your help
Apr 2 '08 #7
BorlandDelphi
18 New Member
Yes, gon on my FREE VB TOOLS and you will find how to SAve and OPen a *.txt FILES.

BorlandDelphi
Apr 2 '08 #8
kadghar
1,295 Recognized Expert Top Contributor
is there a code to load the variables automatically or i have to put them one by one from the beginning??

many thanks for your help
Well, there's not a magic code, but its quite simple. I'll write a little example where i define a couple of public variables, a Sub to save them and a Sub to load them:

Expand|Select|Wrap|Line Numbers
  1. dim Var1 as string
  2. dim Var2 as string
  3.  
  4. sub SaveVars()
  5. dim Lon1 as integer
  6. var1 = inputbox("write Var1") 'you dont need this, is just for this
  7. var2 = inputbox("write Var2") 'example not to have empty variables.
  8. lon1 = freefile
  9. open "C:\SaveGame.txt" for output as #lon1
  10. print #lon1, var1
  11. print #lon1, var2
  12. close #lon1
  13. end sub
  14.  
  15. sub LoadVars()
  16. dim Lon1 as integer
  17. lon1 = freefile
  18. open "C:\SaveGame.txt" for input as #lon1
  19. input #lon1, var1
  20. input #lon1, var2
  21. close #lon1
  22. msgbox "your first variable is: " & var1
  23. msgbox "your second variable is: " & var2
  24. end sub
you can run the first sub to store a couple of words, then close your application, or turn off your computer, then run only the second sub to see how it works (make sure you turn on your computer again before this step).

HTH
Apr 2 '08 #9
BorlandDelphi
18 New Member
Hah, so many code, so many work. Insert my Free VB Tools - Easy Open and Easy Save *.ocx,add to the form and the work is finished

BorlandDelphi
Apr 2 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
25031
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or less complex technical calculations, several input variables. I would like to equipp the starting panel with the usual New, Open, Save, Save As, Close etc. menus (like in Excel, or Word, etc.) What is the best way to accomplish Save, or Save As?...
11
4678
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m having a heck of a time doing so. I have created a form where I use drop downs do specify year, month, date, hour, minute and seconds. When the form is loaded, the dropdowns have to display the proper values for the current time zone type. This
3
2578
by: brian kaufmann | last post by:
Hi, I had sent this earlier, and would appreciate any suggestions on this. I need to make calculations for unemployment rate for three different data sources (A,B,C) for many countries and age groupings. The calculation is: unemployment rate = number of unemployed/number of labour force
3
2265
by: John M | last post by:
Hi, I've been coming up against a failure of a report to display the result of a simple calculation. I have realised that this calculation cannot take place unless the field I am working on is displayed or is some way referred to in the report. am I right in this? It seems odd if the field is there in the underlying query. Is this right? Is there a way round?
0
1251
by: SJM | last post by:
There is a database which has combo boxes to allow users to select values from pre-set lists of common specifications. The form allows users to enter values that are not in the dropdown lists. When all input specifications are entered the user clicks on a button which performs a series of calculations and returns the results. It seems when the user enters values that are not in the drop downs the calculations come back wrong, other wise...
1
3788
by: James Scott | last post by:
Hello, I was wondering if there is a package out there, that allows to convert a date into an int-Timestamp (accuracy needed: 1 sec) and maybe provides some basis time calculations. Background for that is, that I want to save the data into an Hash with an int-timestamp as key. Thanks!
6
1854
by: Sanjay | last post by:
Hi, Is it possible to save all the names/values of a form to another memo textfield before a Insert to the database then when required on another page split that memo textfield into the name and their corresponding values retrieved from the recordset ? Thanks, Sanj
6
4143
by: Josetta | last post by:
Access 2003 I've been experiencing some problems with my "monster" database the last couple of days. I imported all objects into a new database yesterday, which pretty much stopped the crashing problems, but here's something weird: Whenever I copy an object (reports so far), I am able to open it and make changes, but when I try to save it (without closing), it appears to save (message box goes off), but it doesn't. Then, if I try to...
1
7808
by: msanger | last post by:
Hi, I have several excel sheets in Office 2007, which has all kinds of standard calculations, and a consolidated Excel Sheet with totals and rollup of all the other excel files. The issue I am facing is that in order to get the updated totals in the Rollup File, I have to open all the primary excel files one by one, click on update, save and then close them. Once this is done, the rollup file shows the calculations correctly. Is there a VB...
0
9665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6768
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.