A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

sorting uneditable fields in a datasheet



 
 
Thread Tools Display Modes
  #1  
Old June 24th, 2004, 03:59 PM
Don
external usenet poster
 
Posts: n/a
Default sorting uneditable fields in a datasheet

I have fields on a datasheet form that are NOT editable
and others that are. The ones that are NOT editable will
not allow sorting on the datasheet. If I change the field
to Enable=Yes, then the column can be sorted. But this
makes the field editable. The user wants the datasheet,
wants to sort on uneditable fields and wants the
uneditable fields to stay uneditable. Is there a way to
do this? I'm using Access 2002.

THANKS! in advance!
  #2  
Old June 24th, 2004, 06:43 PM
John Vinson
external usenet poster
 
Posts: n/a
Default sorting uneditable fields in a datasheet

On Thu, 24 Jun 2004 07:59:27 -0700, "Don"
wrote:

I have fields on a datasheet form that are NOT editable
and others that are. The ones that are NOT editable will
not allow sorting on the datasheet. If I change the field
to Enable=Yes, then the column can be sorted. But this
makes the field editable. The user wants the datasheet,
wants to sort on uneditable fields and wants the
uneditable fields to stay uneditable. Is there a way to
do this? I'm using Access 2002.

THANKS! in advance!


Not in a datasheet, at least not to my knowledge. You might *try* this
(no guarantees): open the form in design view (as a Form, not a
datasheet); on each such field's BeforeUpdate event put the following
code:

Private Sub fieldname_BeforeUpdate(Cancel as Integer)
Me.fieldname.Undo ' undo any changes the user has made
End Sub

This *should* just quietly undo any changes that the user has made.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
  #3  
Old June 24th, 2004, 07:41 PM
Don
external usenet poster
 
Posts: n/a
Default sorting uneditable fields in a datasheet

I tried this but it didn't do anything. I may not have
done it correctly. I add your lines in the Code Builder.
Is this the correct place? Any other details will be
helpful. Thank you so much for your help!


-----Original Message-----
On Thu, 24 Jun 2004 07:59:27 -0700, "Don"
wrote:

I have fields on a datasheet form that are NOT editable
and others that are. The ones that are NOT editable

will
not allow sorting on the datasheet. If I change the

field
to Enable=Yes, then the column can be sorted. But this
makes the field editable. The user wants the datasheet,
wants to sort on uneditable fields and wants the
uneditable fields to stay uneditable. Is there a way to
do this? I'm using Access 2002.

THANKS! in advance!


Not in a datasheet, at least not to my knowledge. You

might *try* this
(no guarantees): open the form in design view (as a Form,

not a
datasheet); on each such field's BeforeUpdate event put

the following
code:

Private Sub fieldname_BeforeUpdate(Cancel as Integer)
Me.fieldname.Undo ' undo any changes the user has made
End Sub

This *should* just quietly undo any changes that the user

has made.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
.

  #4  
Old June 24th, 2004, 11:43 PM
John Vinson
external usenet poster
 
Posts: n/a
Default sorting uneditable fields in a datasheet

On Thu, 24 Jun 2004 11:41:10 -0700, "Don"
wrote:

I tried this but it didn't do anything. I may not have
done it correctly. I add your lines in the Code Builder.
Is this the correct place? Any other details will be
helpful. Thank you so much for your help!


You need to use your own field names, of course. Could you post the
name of the field, the name of the control, and the actual VBA code
you implemented? Does the event property show [Event Procedure]? If
you open the form as a Single or Continuous form, does it work? (the
event might not fire in a datasheet, I really don't know!)

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
  #5  
Old June 25th, 2004, 02:45 PM
external usenet poster
 
Posts: n/a
Default sorting uneditable fields in a datasheet

Here is the code:

Private Sub LetterNumber_BeforeUpdate(Cancel As Integer)

Me.LetterNumber.Undo ' undo any changes the user has made

End Sub

The field name is LetterNumber. I left the name of the
code as [Event Procedure].

Thank you so much for your help!


-----Original Message-----
On Thu, 24 Jun 2004 11:41:10 -0700, "Don"
wrote:

I tried this but it didn't do anything. I may not have
done it correctly. I add your lines in the Code

Builder.
Is this the correct place? Any other details will be
helpful. Thank you so much for your help!


You need to use your own field names, of course. Could

you post the
name of the field, the name of the control, and the

actual VBA code
you implemented? Does the event property show [Event

Procedure]? If
you open the form as a Single or Continuous form, does it

work? (the
event might not fire in a datasheet, I really don't know!)

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
.

  #6  
Old June 26th, 2004, 03:41 AM
John Vinson
external usenet poster
 
Posts: n/a
Default sorting uneditable fields in a datasheet

On Fri, 25 Jun 2004 06:45:36 -0700,
wrote:

Here is the code:

Private Sub LetterNumber_BeforeUpdate(Cancel As Integer)

Me.LetterNumber.Undo ' undo any changes the user has made

End Sub

The field name is LetterNumber. I left the name of the
code as [Event Procedure].

Thank you so much for your help!


Does the form still allow the user to update LetterNumber? If so,
evidently a Datasheet won't work.

An alternative might be to use the Form's BeforeUpdate event; undo
each control which should be read-only.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to store calculated fields ? Nico Using Forms 13 June 7th, 2004 02:57 PM
Lost text fields in merge CGiannini General Discussion 5 June 4th, 2004 10:23 PM
Lookup fields on label report Howard Setting Up & Running Reports 1 June 3rd, 2004 02:43 AM
Sorting a query is bringing up a parameter request for some fields Donna Running & Setting Up Queries 3 May 31st, 2004 07:51 AM
Calculating fields for Access Galin New Users 6 May 5th, 2004 12:05 AM


All times are GMT +1. The time now is 08:02 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.