Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Grid 1

Status
Not open for further replies.

Easler

Programmer
Jan 11, 2002
6
0
0
US
I have a data grid on a form tied to an adodc which reads from an access database. I can not seem to size the form and grid to where I can put in several hundred records and scroll down later to put in another if necessary. The bottom of the grid bar is below the form. I can not get the form height over 9000. How do you coordiante the form height and grid height to be able to scroll the grid.
 
When a form is loaded the resize event fires. Use code in the resize event handler to set the height and width properties of the grid. Also make the border style of the form resizeable.

Private Sub Form_Resize()
'set error trap to prevent dragging of mouse above or to the left of the window from crashing with negative values
On Error Resume Next

'resize DBGrid when form is resized
DBGrid1.Width = me.Width - 150
DBGrid1.Height = me.Height - 450

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top