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
|
|||
|
|||
enable/disable a row
I have an invoice form that I can select items in the sub form to dispatch.
I want the next time the form is opened the items that have been marked as shipped I want then to be disabled, so they can be seen but not edited, I think my code should be something like: Private Sub Form_Load() if me.check85 = 0 then (this row ) enabled = false end if End Sub I just don't know how I structure the code if anyone can suggest? |
#2
|
|||
|
|||
enable/disable a row
You cannot "disable" a row, only controls on the record for that row. You can,
however, disallow editing, which is what you need to do here. Also, anything like this done in the Form_Load event will only affect the first record displayed! For it to be applied to every record, it needs to be placed in the Form_Current event. Assuming that check85 is ticked to indicate the item has been shipped, then Private Sub Form_Current() If Me.check85 = -1 Then Me.AllowEdits = False Else Me.AllowEdits = True End If End Sub As when using any code of this nature, you need to have a plan for dealing with mistakes when they occur, and trust me, someone will tick the checkbox to indicate an item has been shipped only to find that it hasn't. -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200911/1 |
#3
|
|||
|
|||
enable/disable a row
Many thanks for that, and it works fine, thank you. Do you know if I can set
the 'row' to show as not-enabled or set a condition to the full row so it is highlighted in say, red etc? "Linq Adams via AccessMonster.com" u28780@uwe wrote in message news:9f7fc5b955379@uwe... You cannot "disable" a row, only controls on the record for that row. You can, however, disallow editing, which is what you need to do here. Also, anything like this done in the Form_Load event will only affect the first record displayed! For it to be applied to every record, it needs to be placed in the Form_Current event. Assuming that check85 is ticked to indicate the item has been shipped, then Private Sub Form_Current() If Me.check85 = -1 Then Me.AllowEdits = False Else Me.AllowEdits = True End If End Sub As when using any code of this nature, you need to have a plan for dealing with mistakes when they occur, and trust me, someone will tick the checkbox to indicate an item has been shipped only to find that it hasn't. -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200911/1 |
#4
|
|||
|
|||
enable/disable a row
Its ok I have sorted it thanks
"EddWood" wrote in message ... Many thanks for that, and it works fine, thank you. Do you know if I can set the 'row' to show as not-enabled or set a condition to the full row so it is highlighted in say, red etc? "Linq Adams via AccessMonster.com" u28780@uwe wrote in message news:9f7fc5b955379@uwe... You cannot "disable" a row, only controls on the record for that row. You can, however, disallow editing, which is what you need to do here. Also, anything like this done in the Form_Load event will only affect the first record displayed! For it to be applied to every record, it needs to be placed in the Form_Current event. Assuming that check85 is ticked to indicate the item has been shipped, then Private Sub Form_Current() If Me.check85 = -1 Then Me.AllowEdits = False Else Me.AllowEdits = True End If End Sub As when using any code of this nature, you need to have a plan for dealing with mistakes when they occur, and trust me, someone will tick the checkbox to indicate an item has been shipped only to find that it hasn't. -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200911/1 |
Thread Tools | |
Display Modes | |
|
|