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  

enable/disable a row



 
 
Thread Tools Display Modes
  #1  
Old November 22nd, 2009, 01:52 PM posted to microsoft.public.access.forms
EddWood
external usenet poster
 
Posts: 6
Default 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  
Old November 22nd, 2009, 02:43 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default 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  
Old November 22nd, 2009, 04:19 PM posted to microsoft.public.access.forms
EddWood
external usenet poster
 
Posts: 6
Default 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  
Old November 22nd, 2009, 04:30 PM posted to microsoft.public.access.forms
EddWood
external usenet poster
 
Posts: 6
Default 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

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


All times are GMT +1. The time now is 01:28 PM.


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