Disable moving columns in datasheet view of subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

MS Access 2K, Windows XP
====================
Hi,

I have a subform in a form that displays data in datasheet view, with 6-7
columns. The subform has >Recordset Type< set to "Snapshot" and >Allow
Edit/Add/Delete< set to "No".

I noticed that it is possible for a user to click-and-highlight a column and
then move the entire column before/after columns on either side of it, thus
changing the order of columns.

Is there an easy way to disable this? I would like to display the columns in
a specific order and not have a user move them around.

I've checked the form properties and also searched on the web, with no luck.

Will appreciate a solution to this.

Thanks.

-Amit
 
Is there an easy way to disable this? I would like to display the columns in
a specific order and not have a user move them around.

I'd suggest using Continuous form view rather than Datasheet. You can
make it look very much like a datasheet, but you can control what's in
the header and footer, and the user won't be able to mess it up.

John W. Vinson[MVP]
 
You can use the form's Timer event to set the ColumnOrder property of the
controls ...

Private Sub Form_Open(Cancel As Integer)
Me.TimerInterval = 250
End Sub

Private Sub Form_Timer()

If Me!DepreciationDate.ColumnOrder <> 1 Then
Me!DepreciationDate.ColumnOrder = 1
Me!DepreciationAmount.ColumnOrder = 2
End If

End Sub
 
John Vinson said:
I'd suggest using Continuous form view rather than Datasheet. You can
make it look very much like a datasheet, but you can control what's in
the header and footer, and the user won't be able to mess it up.

John W. Vinson[MVP]

Hi John,

Thanks for the prompt response. I must say very elegant solution. I tried
out your suggestion, and it serves my purpose.

Thanks, and have a nice weekend!

-Amit
 
Brendan Reynolds said:
You can use the form's Timer event to set the ColumnOrder property of the
controls ...

Private Sub Form_Open(Cancel As Integer)
Me.TimerInterval = 250
End Sub

Private Sub Form_Timer()

If Me!DepreciationDate.ColumnOrder <> 1 Then
Me!DepreciationDate.ColumnOrder = 1
Me!DepreciationAmount.ColumnOrder = 2
End If

End Sub

Hi Brendan,

Thanks for your response. That's an interesting idea and I'll try it out and
see if it works for me.

Cheers,

-Amit
 
Back
Top