Normal Topic prohibit saving in update mode (Read 1239 times)
nelsona
Member
*
Offline


No personal text

Posts: 10
Joined: Jan 10th, 2006
prohibit saving in update mode
Apr 6th, 2006 at 1:28pm
Print Post Print Post  
I am tring to get it so that when certain users are in the DB they can search through the records but not modify them;
notifyform(1) just seems to keep them at the first record

Is there anyway around this?
  
Back to top
 
IP Logged
 
nelsona
Member
*
Offline


No personal text

Posts: 10
Joined: Jan 10th, 2006
Re: prohibit saving in update mode
Reply #1 - Apr 6th, 2006 at 1:54pm
Print Post Print Post  
I figuerd it out, as I only allowed the users to read the db in the security manager,  but now another question,  when i do this everything turns gray, is there anyway to keep that from happening the color scheme as it is righ now makes it impossible to read.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: prohibit saving in update mode
Reply #2 - Apr 6th, 2006 at 2:37pm
Print Post Print Post  
In SBasic on Form Entry, you could (after checking mode):
Code
Select All
var aa as string
var name as string
var loop as int
var cnt as int

aa = @StringArrayElementList()
cnt = @CountStringArray(aa)

for loop = 1 to cnt
	  name = @AccessStringArray(aa, loop)
	  SetThisElement(name)
	  // The 2 in the line below means - read only but not grayed out
	  ReadOnly(ThisElement, 2)
next
UnSetThisElement()
 


  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: prohibit saving in update mode
Reply #3 - Apr 6th, 2006 at 2:47pm
Print Post Print Post  
The Code mark posted works in 1.1.4 but in 1.1.3 you have to first set the element to be not Read-Only before you can set it to be Read-Only not Grayed Out.

The code below will work for you in 1.1.3. You will also want to check @Group, so that it only affects the people not allowed to edit.

Code
Select All
var aa as string
var name as string
var loop as int
var cnt as int

aa = @StringArrayElementList()
cnt = @CountStringArray(aa)

for loop = 1 to cnt
   name = @AccessStringArray(aa, loop)
   SetThisElement(name)
   ReadOnly(ThisElement, 0)
   ReadOnly(ThisElement, 2)
next
UnSetThisElement()  



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: prohibit saving in update mode
Reply #4 - Apr 7th, 2006 at 11:06am
Print Post Print Post  
Hello Ray,

that's fantastic! 

The code works fine, but does affect the tabs and subforms!
so i can not see the fields and Subforms in the Tabs.
how can i make that does not apply for tabs?

Please get no crazy ideas and leave us hanging!!

Any ideas?
Thanks!
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: prohibit saving in update mode
Reply #5 - Apr 10th, 2006 at 6:43pm
Print Post Print Post  
Hello Amor,

You just need to add an If statement to the code so that it does not affect the Tab Pages. Below is an example.

Code
Select All
Var vStr as String
Var vCnt as Int
Var vLoop as Int
Var VName as String

vStr = @StringArrayElementList()
vCnt = @CountStringArray(vStr)
vLoop = 1

While vLoop <= vCnt
{
	vName = @AccessStringArray(vStr, vLoop)
	SetThisElement(vName)
	If @ElementType(ThisElement) <> 1017 Then
	{
		ReadOnly(ThisElement, 0)
		ReadOnly(ThisElement, 2)
	}
	vLoop = vLoop + 1
}
UnSetThisElement() 



@ElementType() can be found on pages 115-116 of the Sesame 1.1 Programming Guide.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: prohibit saving in update mode
Reply #6 - Apr 12th, 2006 at 8:18am
Print Post Print Post  
Hello Ray!
Thank you for the quick reply.

I have five TabPages, each TabPage have 4 tabs.
I can not see the elements in the deep on tabs.
I'm talking about stacking 4 TabPages on top of (or inside of) one another.

Only the first level of tabs is visibile!

Thank you again.


  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: prohibit saving in update mode
Reply #7 - Apr 18th, 2006 at 4:57pm
Print Post Print Post  
Hello Ray!
Thank you for the quick reply.

I have five TabPages, each TabPage have 4 tabs.
I can not see the elements in the deep on tabs. 
I'm talking about stacking 4 TabPages on top of (or inside of) one another.

Only the first level of tabs is visibile!

Thank you again.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: prohibit saving in update mode
Reply #8 - Apr 18th, 2006 at 5:08pm
Print Post Print Post  
Try
Code
Select All
Var vStr as String
Var vCnt as Int
Var vLoop as Int
Var VName as String

vStr = @StringArrayElementList()
vCnt = @CountStringArray(vStr)
vLoop = 1

While vLoop <= vCnt
{
 vName = @AccessStringArray(vStr, vLoop)
 SetThisElement(vName)
 If((@ElementType(ThisElement) <> 1017) And (@ElementType(ThisElement) <> 1016)) Then
 {
  ReadOnly(ThisElement, 0)
  ReadOnly(ThisElement, 2)
 }
 vLoop = vLoop + 1
}
UnSetThisElement() 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged