PDA

View Full Version : Auto Format Datasheet



Lister
05-11-2005, 01:23 PM
Hey guys.

Well this is a new on for me, the idea is this.

By using a datasheet view in a subform and a custom popup menu I can allow users to filter down to the records they wish to view, in whatever order they want, and then allow them to open/edit said records with a Double-Click Event.

Fact is there are so many ways that different departments wish to filter this works in theory and in a sample I have created. A search or filter form would be huge. This seems simpler.

Ok, all good in theory, I can restrict ?new? and ?edit? etc, but I can just see users resizing the datasheet view to something only brain dead users could do or hiding columns. <SHUDDER>

So my question is, can or is there some why that I can use the OnOpen or OnLoad event to re-size the datasheet to a default size? (Well the fields in the datasheet mainly) This would allow you average bi-polar user to mess and re-size until their coffee mugs run out and the next user doesn?t get left a mess. (Which would then force them to ring me!) <SHUDDER>

I hope this makes sense, I really hope someone can point me in the right direction.
Have a look at the sample database attached to get a better idea of what I mean.

Thanks

Lister
05-11-2005, 09:15 PM
All good, worked it out.

Bloody simple really, you can adjust each column at the OnOpen Event.



Private Sub Form_Open(Cancel As Integer)

Me.lngsubID.ColumnWidth = 0
Me.fklngMain.ColumnWidth = 0
Me.strsubtext1.ColumnWidth = 3000
Me.strsubtext2.ColumnWidth = 2500

End Sub


So each column will be resized on open of the main form.
Hope this helps someone :)