Help

J

Justin

1) I have this database when it opens, it checks to see if the file is less
than 500,000kb.
If it is over, then a msg will appear and will ask the user to please
compact the database
now my problem is teh coding.

Sub ApplicationInformation()
Dim Tmp_Filesize As Long
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Tmp_Filesize = (FileLen("F:\System Analyst\DTF.mdb")) / 1024
If Tmp_Filesize > 300000 Then

MsgBox ("Database Size is greater then 500,0000 KB, Please Compact
Database") ' Define message.
Style = vbOK + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "DB Size Warning" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
End If

End Sub


See, everytime i move this database from different location, i have to
change the tmp_file name in this code. Is there a way to have it so that it
checks the database no matter the location the database is store??



2) Also, is there any code out there where I can have this database resize
it self depending on the users' resolution screen
 
T

Tom Wickerath

Hi Justin,

I'll take a stab at answering your first question. If you are running Access
2000 or later, you can replace the line of code that reads:

Tmp_Filesize = (FileLen("F:\System Analyst\DTF.mdb")) / 1024

with this:

Tmp_Filesize = (FileLen(CurrentProject.FullName)) / 1024

Your message box statement should read:

MsgBox ("Database Size is greater then 300,000 KB, Please Compact Database
")

in order to be consistant with your IF...THEN logic.

As for re-sizing stuff, which I admittedly know very little about, you can
check out Stephen Leban's website:

http://www.lebans.com/_vti_bin/shtml.exe/search.htm

Search for the word: resize

Also, you might be interested in this (?), but it's not free:

http://www.fmsinc.com/products/components/index.html

If my answer has helped you, please answer yes to the question that reads
"Did this post answer the question?", which should be visible at the bottom
right corner of your screen.

Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

1) I have this database when it opens, it checks to see if the file is less
than 500,000kb.
If it is over, then a msg will appear and will ask the user to please
compact the database
now my problem is teh coding.

Sub ApplicationInformation()
Dim Tmp_Filesize As Long
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Tmp_Filesize = (FileLen("F:\System Analyst\DTF.mdb")) / 1024

If Tmp_Filesize > 300000 Then

MsgBox ("Database Size is greater then 500,0000 KB, Please Compact
Database") ' Define message.
Style = vbOK + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "DB Size Warning" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic

End If

End Sub


See, everytime i move this database from different location, i have to
change the tmp_file name in this code. Is there a way to have it so that it
checks the database no matter the location the database is store??


2) Also, is there any code out there where I can have this database resize
it self depending on the users' resolution screen
 
Top