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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |