Show database size on form?

  • Thread starter Thread starter Harmannus
  • Start date Start date
H

Harmannus

Hallo,

Is it possible to show/calculate the database size in a field on a form?

<size> bytes

e.g. 2.716.300 bytes

Regards,

Harmannus, The netherlands
 
You could try

me.txtFilesize = FileLen("yourdatabase.mdb")

Substitute your own names for the text box and database file name

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Hallo,

Thanx for the response.

I want to show this automatically when i open a form. Behind which event do
i put this to achieve this?

Thanx for any tips.

Regards,

Harmannus
 
If you only want the value when you open the form, put it in the Form Open
event. If you want to track changes as you add data to the form, put it in
the After Update event.

Mind you, the file size is a pretty meaningless number for Access. It wont
reflect deletions until you do a compact of the database, and adding a 1
character record may change the size arbitrarily, even a couple of KB if a
lot of indexes are updated in the process.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Thanx for the response!

It is just a "information" field in a "about" pop-up.

I will give your suggestions a try!

Regards,

Harmannus
 
Back
Top