I was wondering if there was a way to enable the user to set variables that remain set until the user changes them when desired, even after the database has been closed and the computer shutdown.
For instance, if you wanted the user to be able to specify where the Backup files were stored and not have to enter the address every time a Backup was made, similar to saving a document in Microsoft Word; once the location is set it isnt asked for unless the user wishes to.
I am aware that is a pretty loose comparison, as Word will have the original file to save over and therefore the address to save to.
I was just hoping there was a way to set the variable permanently, or at least to remember the address entered the last time and display that as the default along with a 'save' and 'browse' button.
Thanks,
NDayave
7 1979
When you want to save something permanently you have to write it to non-volatile media. i.e. a hard drive, floppy, etc. But more specifically a file. In your case, just write it to a table where you keep permanent variables, you can lookup and update the table as needed through code.
When you want to save something permanently you have to write it to non-volatile media. i.e. a hard drive, floppy, etc. But more specifically a file. In your case, just write it to a table where you keep permanent variables, you can lookup and update the table as needed through code.
Yeah, thats the solution I arrived at, is there no way to change the actual code so the Variable is set there, for example:
Var1 = "C:\My Documents"
Which can be changed by the user through the Forms:
Var1 = "C:\My Documents\Backup"
without the need for the user to manually edit the code, as this would save a lot of space and would probably require less work the next time a Permanent variable is required.
Thanks for the reply,
NDayave
As far as I know, you can't change the coding through code. I think you and import code from a text file in which case you can change the text file that holds the code but that's just more convoluted than storing it in a file.
As far as I know, you can't change the coding through code. I think you and import code from a text file in which case you can change the text file that holds the code but that's just more convoluted than storing it in a file.
Hmmm, okays thanks for your time anyway. I investigate urther, if i find an answer ill put it here.
Thanks again,
NDayave
I was wondering if there was a way to enable the user to set variables that remain set until the user changes them when desired, even after the database has been closed and the computer shutdown.
For instance, if you wanted the user to be able to specify where the Backup files were stored and not have to enter the address every time a Backup was made, similar to saving a document in Microsoft Word; once the location is set it isnt asked for unless the user wishes to.
I am aware that is a pretty loose comparison, as Word will have the original file to save over and therefore the address to save to.
I was just hoping there was a way to set the variable permanently, or at least to remember the address entered the last time and display that as the default along with a 'save' and 'browse' button.
Thanks,
NDayave
I was wondering if there was a way to enable the user to set variables that remain set until the user changes them when desired, even after the database has been closed and the computer shutdown
You can write permanent (persisting) values to the System Registry. These values can be written, edited, and retrieved at will. You do not run the risk of anyone modifying these values since they are not stored internally,
You can write permanent (persisting) values to the System Registry. These values can be written, edited, and retrieved at will. You do not run the risk of anyone modifying these values since they are not stored internally,
How would I go about doing that? Would it involve creating a new file that would be project specific, or is it more generic than that?
How would I go about doing that? Would it involve creating a new file that would be project specific, or is it more generic than that?
This may not be exactly what you are looking for, but it is an alternative to consider as far as permanent storage goes: - Dim strPathToFile As String
-
-
strPathToFile = "C:\Test Directory\TestFile.txt"
-
-
'To Save the File's Path to the System Registry. It will be saved in MyComputer\HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Test Database\Text File Location
-
Dim strPathToFile As String
-
-
strPathToFile = "C:\Test Directory\TestFile.txt"
-
-
'To Save the File's Path to the System Registry
-
SaveSetting appname:="Test Database", Section:="Text File Location", _
-
Key:="Absolute File Path", setting:=strPathToFile
-
-
'To retrieve the File's Path and assign it to a variable
-
strPathToFile = GetSetting(appname:="Test Database", Section:="Text File Location", _
-
Key:="Absolute File Path", Default:="Path not stored")
-
-
MsgBox strPathToFile 'returns C:\Test Directory\TestFile.txt
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: KemperR |
last post by:
Hello Experts outhere,
may be someone can tell me whats going wrong with my ADOX trial.
I have an Access 2002 database with some tables and queries (views)
The code listed below works well up...
|
by: CFW |
last post by:
References in Access and .mdb files have always been painful for me -
just when I thought I was OK in an .mdb, I have a .adp I'm working on
and I need to use Set db as CurrentDb - Constant "object...
|
by: Melanie |
last post by:
In AccessXP(A2000 mode), how do I make the change of references from ADO to
DAO3.6 permanent?
I go into references and uncheck ADO then scroll down to DAO3.6 and check it. I
close references and...
|
by: jsale |
last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app
i have made is running on IIS v6 and consists of a number of pages that allow
the user to read information from the...
|
by: Joe Schmoe |
last post by:
I am working on an ASP.NET application that generates an Excel 2003
spreadsheet on demand for the user, containing much sales information, and
then editable cells for the salerep user to enter...
|
by: Gary T via AccessMonster.com |
last post by:
I have a couple of lulus here but I'll address the other one in "Queries".
This one pertains to allowing users with read-only access to use the database
whilst a person with admin access is using...
|
by: spam.noam |
last post by:
Hello,
I discovered that I needed a small change to the Python grammar. I
would like to hear what you think about it.
In two lines:
Currently, the expression "x" is a syntax error.
I suggest...
|
by: Gus |
last post by:
We create reports in MSWord 2000 from within our Access 2002
application. The report template uses a lot of tables and nested
tables.
Over time, many hundreds of reports, Word has become...
|
by: chromis |
last post by:
Hi,
I've been trying to implement a more OOP oriented approach to dealing with user security on one of my websites, and I am trying to validate the user against an array of roles, however I am...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| | |