Normal Topic What would happen? (Read 638 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
What would happen?
Dec 29th, 2006 at 1:59pm
Print Post Print Post  
In my Invoice form, I have several sections which contain parallel columns of elements for entering prices.  The left hand column elements can be filled by a lookup into the Workorder database, or entered manually.  The right hand column is for manual entry only.  I need to restrict the user so that he can only use one column.  That is, if anything is entered in the left hand column, entry into the right hand column is forbidden.

I plan to be experimenting with ReadOnly(), so that if any of one column's elements have a value, the other column becomes read only.  Before I head down that road, I have a question:

Say a user creates an Invoice and puts some figures into the manual right hand column (that is, he does not perform the Workorder lookup).  The left hand column will become Read Only.  He saves the record and goes on a coffee break.

Later he remembers some extra work that was performed on the job, so he updates the Workorder.  Then he goes back into the Invoice record and performs the Lookup.  The programming will retrieve the values from the Workorder and try to jam them into the left hand Read Only elements in the Invoice. 

What would happen?  Would the elements fill or not?  If they do then I'll have values in both the left and right hand columns, which would be a bad thing.  Would the lookup just fail?  Failure wouldn't necessarily be bad, because I could program a message saying "Oops, you gotta delete those other values first".

Thanks in advance for your help.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: What would happen?
Reply #1 - Dec 29th, 2006 at 2:14pm
Print Post Print Post  
Use an If condition to instruct your program to check for this condition before doing the lookup.
  

- Hammer
The plural of anecdote is not data.
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: What would happen?
Reply #2 - Dec 29th, 2006 at 3:33pm
Print Post Print Post  
Ah, of course, thanks.  That will work.  I'm still interested in what would happen though.

So far, I've programmed the left column to turn the right column Read Only when a value is entered in the left.  However, pressing "Enter" still jumps me into the Read Only element.  I can't edit it, but that's where I land.  Will I need to program some "Go To" statements?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: What would happen?
Reply #3 - Dec 29th, 2006 at 3:41pm
Print Post Print Post  
Infinity wrote on Dec 29th, 2006 at 3:33pm:
Ah, of course, thanks.  That will work.  I'm still interested in what would happen though.


Programming will fill a field even if it is read only.

BTW, one way to find out what will happen in this kind of situation is to try it and see.
  

- Hammer
The plural of anecdote is not data.
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: What would happen?
Reply #4 - Dec 29th, 2006 at 4:34pm
Print Post Print Post  
Quote:
Programming will fill a field even if it is read only.


Thank you.

Quote:
BTW, one way to find out what will happen in this kind of situation is to try it and see.


Yep, but I figured that if it would result in the situation you describe, it would be hours of wasted time and effort.  You've saved me all that, and I appreciate it.  I'll fade back into silence now.
  

**
Captain Infinity
Back to top
IP Logged