S
Shane
I want to change the height of a list box depending on
how many records it has but I can get it to work on the
OnLoad property of the form. It keeps disapearing when I
open the pop up form.
Here's my code:
Private Sub Form_Load()
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim sql As String
Dim MyCount As Long
Dim MyM, MyH As Double
'MyM is the Height that needs to be increased with each
additional record
MyM = 0.147
sql = "SQL"
Set db = CurrentDb()
Set rec = db.OpenRecordset(sql)
MyCount = rec.RecordCount
MyH = MyCount * MyM
Me.lstInactive.Height = MyH
db.Close
Set rec = Nothing
End Sub
All th calculation are right but the height is not
changing.
how many records it has but I can get it to work on the
OnLoad property of the form. It keeps disapearing when I
open the pop up form.
Here's my code:
Private Sub Form_Load()
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim sql As String
Dim MyCount As Long
Dim MyM, MyH As Double
'MyM is the Height that needs to be increased with each
additional record
MyM = 0.147
sql = "SQL"
Set db = CurrentDb()
Set rec = db.OpenRecordset(sql)
MyCount = rec.RecordCount
MyH = MyCount * MyM
Me.lstInactive.Height = MyH
db.Close
Set rec = Nothing
End Sub
All th calculation are right but the height is not
changing.