Hot Topic (More than 10 Replies) Can U have read only field filled by progamming? (Read 1279 times)
digimom1962
Junior Member
**
Offline


Natalie Gann

Posts: 92
Location: here
Joined: Nov 26th, 2004
Can U have read only field filled by progamming?
Jan 27th, 2006 at 2:53pm
Print Post Print Post  
I have the ticket# auto filled when the order date is selected. Problem is, it also fills if someone clicks on the field. Just setting as read only or using security to keep someone from editing the field seems to make the programming non-functional.

Pretty sure I just missed something but this is really one of the few last things before the program will be functional.Shocked

Thanx
~Natalie
  

So much time and so little to do . . . strike that, reverse it.
Back to top
YIM YIM  
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Can U have read only field filled by progammin
Reply #1 - Jan 27th, 2006 at 4:45pm
Print Post Print Post  
There should be no problem to have programming fill in the value of a ReadOnly element.  I do it constantly.

How are you doing this?
What is the programming?
And how/where is the programming executed?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
digimom1962
Junior Member
**
Offline


Natalie Gann

Posts: 92
Location: here
Joined: Nov 26th, 2004
Re: Can U have read only field filled by progammin
Reply #2 - Jan 27th, 2006 at 5:03pm
Print Post Print Post  
Ok:

The programming in the field "ticket_number"  on element entry:

      if Ticket_number = ""

      {
            Ticket_number = @number(1)
      }

      throwfocus(service date)
****************************

The programming in "order date:" on element exit:

      throwfocus(Ticket_number)

***********************

Just in typing this I think I see WHY there is a problem, can't exactly throwfocus to a read only field can I?

Since there are only about 3 people using the program I could just tell them not to click there Roll Eyes but I am sure there is more graceful solution....

Thanx
~Natalie
  

So much time and so little to do . . . strike that, reverse it.
Back to top
YIM YIM  
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Can U have read only field filled by progammin
Reply #3 - Jan 27th, 2006 at 6:07pm
Print Post Print Post  
Make sure the Ticket_Number element is bound to a number field, and is ReadOnly. 
Keeping the programming in the OnEntry section is OK.

If you are using @Number for the Ticket_Number element, then
Change from:
Code
Select All
 if Ticket_number = ""

  {
   Ticket_number = @number(1)
  }  

Change To:
Code
Select All
If @IsBlank(Ticket_number) Then   {
   Ticket_number = @number
  } 



You can ThrowFocus to a ReadOnly field, but won't be able to change the value.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
digimom1962
Junior Member
**
Offline


Natalie Gann

Posts: 92
Location: here
Joined: Nov 26th, 2004
Re: Can U have read only field filled by progammin
Reply #4 - Jan 27th, 2006 at 6:36pm
Print Post Print Post  
Thanx Bob

I switched the programming to what you gave me (when it isn't read only) and it still works fine. What are the advantages in the different format?

Now onto the "read only" issue.

I only want the ticket number to show up if they actually intend to use the ticket. The only way I have determined to tell for sure is if they enter the order date. When they click the order date field the ticket number automatically updates. If I make the ticket number field read only it doesn't update.

The last thing you said was  "You can ThrowFocus to a ReadOnly field, but won't be able to change the value."
Unfortunately, that is what I want to do, change the value, (I think- maybe I mis-understand). I believe I have found another mire to flounder in. Tongue

I might just put a tooltip saying DON'T CLICK HERE Grin

~Natalie
  

So much time and so little to do . . . strike that, reverse it.
Back to top
YIM YIM  
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Can U have read only field filled by progammin
Reply #5 - Jan 27th, 2006 at 7:08pm
Print Post Print Post  
Quote:
I only want the ticket number to show up if they actually intend to use the ticket. The only way I have determined to tell for sure is if they enter the order date. When they click the order date field the ticket number automatically updates. If I make the ticket number field read only it doesn't update.


Hello,

Since you want to fill in the Ticket_Number element if they enter an Order Date why not program the On Element Exit event of the Order Date element so that it fills in the Ticket_number element rather than having it ThrowFocus() to the element you are trying to fill in.
Code
Select All
If ((@IsBlank(Ticket_Number)) and (Not @IsBlank(order date:))) Then
{
  Ticket_Number = @Number
} 



-Ray
« Last Edit: Jan 27th, 2006 at 8:15pm by Ray the Reaper »  

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


Natalie Gann

Posts: 92
Location: here
Joined: Nov 26th, 2004
Re: Can U have read only field filled by progammin
Reply #6 - Jan 27th, 2006 at 8:07pm
Print Post Print Post  
You know Ray . . . that is an EXCELLENT question. Roll Eyes

I guess it is because I started with the one plan and just didn't know enough to step back and start with another tack when I had to make the ticket# field read only.

Works beautifully now, thanx.
~Natalie

PS: I know you were just testing me by putting that extra "(" in front of @IsBlank.
  

So much time and so little to do . . . strike that, reverse it.
Back to top
YIM YIM  
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Can U have read only field filled by progammin
Reply #7 - Jan 27th, 2006 at 8:15pm
Print Post Print Post  
Quote:
PS: I know you were just testing me by putting that extra "(" in front of @IsBlank.


Actually, I forgot to put another one at the end of the statement. I'll fix that here shortly.

-Ray
  

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


Natalie Gann

Posts: 92
Location: here
Joined: Nov 26th, 2004
Re: Can U have read only field filled by progammin
Reply #8 - Jan 27th, 2006 at 8:19pm
Print Post Print Post  
Worked fine when I took it out for some reason ???

Thanx again
  

So much time and so little to do . . . strike that, reverse it.
Back to top
YIM YIM  
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Can U have read only field filled by progammin
Reply #9 - Jan 27th, 2006 at 8:25pm
Print Post Print Post  
It will work either way. The () are control structures and are used to group multiple statements together. I tend to group more than most people.

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Can U have read only field filled by progammin
Reply #10 - Jan 27th, 2006 at 8:42pm
Print Post Print Post  
Quote:
I tend to group more than most people.

Static cling will do that to you.  Have you tried Bounce sheets in the dryer?

Wink
  

**
Captain Infinity
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: Can U have read only field filled by progammin
Reply #11 - Jan 27th, 2006 at 8:58pm
Print Post Print Post  
Scott,

Geez after all the help I give you, this is how you treat me.

You have the great honor of being the reason behind a new Sbasic Command. With you in mind I just wrote @BadJoke() which returns a 0 if the joke passed to it is not a bad joke. If the joke is a bad joke it returns a number between 1 and 100 which says how bad the joke is. It needs a little bit more work as I gave it your joke and got a return value of 732338. Wink

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Can U have read only field filled by progammin
Reply #12 - Jan 27th, 2006 at 9:03pm
Print Post Print Post  
Quote:
Geez after all the help I give you, this is how you treat me.


I can't help it.  It's just how I am.  See my web site for details: http://captaininfinity.us

But I don't want you to ever ever think that I'm not grateful for all the help you provide.  And Erika and Mark, too.  I know of no other software developers that help users the way you folks do.  You're just incredible and I hope Sesame makes you all rich.

Quote:
You have the great honor of being the reason behind a new Sbasic Command. With you in mind I just wrote @BadJoke() which returns a 0 if the joke passed to it is not a bad joke. If the joke is a bad joke it returns a number between 1 and 100 which says how bad the joke is. It needs a little bit more work as I gave it your joke and got a return value of 732338.


YAY!  Any chance you can change the name to "@Infinity()"?  I'LL BE FAMOUS, I WILL!
  

**
Captain Infinity
Back to top
IP Logged