Question

Oracle Forms - Checkboxes - When-Checkbox-Changed Trigger

Asked by: VibertH

I have a form that has a five checkboxes.  Two of the checkboxes (let's call them box4 and box5) cannot both be checked.  For example, if box4 is checked, box5 will uncheck and vice versa.  I am new to SQL/PL and do not know what to code in the trigger to get this done.  

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-07-24 at 13:20:58ID22718204
Tags

oracle

,

forms

,

checkbox

Topics

Oracle 9.x

,

PL / SQL

,

Oracle Database

Participating Experts
3
Points
500
Comments
40

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. explain  trigger
    please explain trigger. what are trigger actually mean in Oracle
  2. triggers
    hi every1.. i m making a project in oracle.. the project is for a company which sells and buys products so there is a stock table a purchase table and a sales table.. what i want 2 do is that when some1 inserts data in the sales table and requried stock is not available then...
  3. Trigger
    hello experts, i want to create trigger in which case it should create a table at sunday 12.00 noon and drop the table on the next day 1.00 noon automatically ?? i mean is it really possible if so can u just show me with an example?? Thanxs Shyam.
  4. Triggers
    can any one tell me about the tyyes of triggers. Implicit, explicit........ Are form triggers different from PL/SQL triggers?(i.e. Interface triggers and Navigational triggers) Can any one give me a clear picture on classification of triggers i.e. types of triggers. Thank ...
  5. Oracle Triggers
    I am having trouble creating Triggers in Oracle. I cannot seem to get the trigger to compile, but i cannot see what is wrong with the code. Any Ideas? DROP TRIGGER module_value; CREATE TRIGGER module_value AFTER UPDATE OR INSERT ON assessment FOR EACH ROW DECLARE total_valu...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: sujit_kumarPosted on 2007-07-24 at 13:52:54ID: 19559972

What is the value you have set for these checkboxes? Is it '0' and '1' OR 'Y' and 'N' or anything else?

Letz say it is 'Y' or 'N' then use the following.

For box4 do the following,
if :box4 = 'Y' then
:box5 := 'N';
else
:box5 := 'Y';
end if;

 

by: sujit_kumarPosted on 2007-07-24 at 13:53:34ID: 19559979

same way do the coding for box5 also,

if :box5 = 'Y' then
:box4 := 'N';
else
:box4 := 'Y';
end if;

 

by: VibertHPosted on 2007-07-24 at 14:03:23ID: 19560066

Yes, it uses Y and N.

So in the When-checkbox-change trigger I should put (syntax and code):
BEGIN
     IF CHECKBOX_CHECKED(:BLOCK.BOX4)
                :BLOCK.BOX5 := 'N'
    END IF;
END;

Will this work?

 

by: sujit_kumarPosted on 2007-07-24 at 14:06:32ID: 19560100

i think you can do like this. i am unable to test it as i don't have forms developer with me now.

BEGIN
     IF CHECKBOX_CHECKED(:BLOCK.BOX4)
                :BLOCK.BOX5 := 'N'
     ELSE
                  :BLOCK.BOX5 := 'Y'
    END IF;
END;

 

by: markgeerPosted on 2007-07-24 at 19:27:08ID: 19561966

If you change checkboxes 4 and 5 to radio buttons that are in the same group, Oracle Forms will automatically make sure that only one gets selected.

Or, if you prefer to keep them as checkboxes, you need to have code like sujit_kumar suggested on each of them making sure that the opposite one gets unchecked whenever the user checks either one.

 

by: prast1007Posted on 2007-07-24 at 19:58:19ID: 19562166

You can create a program unit, let's say SPR_CHECK_VALUES(nmbVal number)  like below:

PROCEDURE SPR_CHECK_VALUES (nmbVal number) is
BEGIN
    if nmbVal = 0 and :BOX4 = 'Y' then
       :BOX5 := 'N';
    elsif nmbVal = 0 and :BOX4 = 'N' then
       :BOX5 := 'Y';
    elsif nmbVal = 1 and :BOX5 = 'N' then
       :BOX4 := 'N';
    elsif nmbVal = 1 and :BOX5 = 'N' then
       :BOX4 := 'Y';
   end if;
end;

and then create a WHEN_CHECK_BOX_CHANGE trigger on both box4 & box5 item,
In box4 trigger call the above program unit
SPR_CHECK_VALUES(0);
and in box5 trigger call the above program unit using:
SPR_CHECK_VALUES(1);

I wish it will help !

 

by: prast1007Posted on 2007-07-24 at 20:00:29ID: 19562199

The trigger you should create is When-checkbox-change trigger on both :box4 & :box5 item

 

by: VibertHPosted on 2007-07-25 at 06:38:49ID: 19565198

I don't want radio buttons because I want the page to look uniformed.  I want everything to be checkboxes. But thanks for the suggestion.  

This is what I did:  

I went to the Data Block --> <Block Name> --> Item --> <Checkbox Name> --> Triggers ->> WHEN-CHECKBOX-CHANGED.  I then went into the PL/SQL for WHEN-CHECKBOX-CHANGED.  And I typed

BEGIN
      IF CHECKBOX_CHECKED(:TAX_TYP.MV_LIC_YN)
      THEN
            :TAX_TYP.DR_LIC_YN := 'N';
      END IF;

END;

I didn't use the else because I don't want it to do anyting if it is unchecked.  When I check the box, I get this error:

Unable to resolve reference to item Y.  The other box is not unchecked either.

When I uncheck it I get:

Unable to resolve reference to item N.  

 

 

by: sujit_kumarPosted on 2007-07-25 at 07:19:57ID: 19565578

see if 'Y' or 'N' are the values that corresponds to the checkbox checked versus checkbox unchecked. Please see the property of these checkbox.

 

by: VibertHPosted on 2007-07-25 at 07:40:01ID: 19565773

In the properties, it has 'Value when checked' and I put Y and for 'Value when unchecked' I put N.

 

by: VibertHPosted on 2007-07-25 at 08:29:31ID: 19566382

Ok, I got it.  I removed the Checkbox_Checked function and used the below code.  

BEGIN
      IF (:TAX_TYP.MV_LIC_YN = 'Y')
      THEN
            :TAX_TYP.DR_LIC_YN := 'N';
      END IF;

END;

This works fine except it only works on the first row returned.  How can I get it to work on all rows returned from the data block.

 

by: VibertHPosted on 2007-07-25 at 09:42:05ID: 19567251

Is there a way to get this code to work for all rows returned from the data block?

 

by: markgeerPosted on 2007-07-25 at 10:07:53ID: 19567539

When do you need this to happen?  Do you really want (or need) this at query time for every row retrieved? (That would surprise me.)   Or, do you only need this at data entry time when the record is being added or changed?  (This is what I thought you were asking for.)

 

by: VibertHPosted on 2007-07-25 at 11:35:55ID: 19568424

Let me explain a little more.  There is a data block that returns multiple rows.  I am not concerned with adding and deleting the rows.  That part of the code is is completed.  I am adding two additional columns of checkboxes, hence five columns of checkboxes.  The other three columns are not concerned with which other columns are checked.  But for the last two it matters.  Only one of the two can be checked at one time.  

So each row has five cloumns of checkboxes.  The trigger is only working on the first row.  The other rows do not raise the trigger and I don't know why not.

 

by: VibertHPosted on 2007-07-25 at 11:37:03ID: 19568434

I need for it to happen during the insert and update.

 

by: markgeerPosted on 2007-07-25 at 12:25:16ID: 19568855

"I am not concerned with adding and deleting the rows."
and:
"I need for it to happen during the insert and update."

Which of those statements do you want us to believe?  They cannot both be true, since "adding" = an "insert".

You also said you have: "a data block that returns multiple rows" and: "The trigger is only working on the first row.  The other rows do not raise the trigger."  If you want this trigger to fire on every row retrieved by a query in the block, then it must be a POST-QUERY trigger.  But, do these two checkboxes correspond to two columns in the table?  If yes, then using a POST-QUERY trigger to modify the values of the checkboxes is usually *NOT* a good idea.  That will prompt the user then with the message: "Do you want to save your changes?" after every query, but the user may think: "I didn't change anything! Why am I getting this message?"

I think we do not understand the business problem that you are trying to solve with these checkboxes, and maybe using checkboxes in an Oracle form is not the best or easiest way to solve the problem.  Can you describe more of the data problem you are trying to solve with these checkboxes?

 

by: VibertHPosted on 2007-07-25 at 13:48:50ID: 19569671

OK.  Let me try again.  (I wish there was a way to show you the form. )  I am taking an existing form that the update, delete, and insert already worked for.  That's why I said I wasn't concerned with that.  (I know, it was a little misleading.)  So, what I need to do to the form is add two more columns of checkboxes.  I have added the columns to the table using the alter table command and it retuns to the form all of the required info, including the Y and N for the checkboxes.  The problem I am having is on the first row returned, the triggers works.  For examlple, if box4 is checked when I check box5, it will uncheck box4 and vice versa.   But for the second row (second record returned), it's now working.  I can check both columns and it chouldn't allow that.  Of the two columns, only one column can be checked for any row.

 

by: prast1007Posted on 2007-07-25 at 18:31:11ID: 19571267

Is there a way to get this code to work for all rows returned from the data block?

VibertH,
The trigger (WHEN-CHECKBOX-CHANGED) should works on item levels, not the item_instance level, and I'm sorry that I write the wrong procedure.

Just try to create a program unit like below :
PROCEDURE spr_check_values (nmbVal int) IS
BEGIN
  if nmbVal = 0 and :TAX_TYP.DR_LIC_YN = 'Y' then
     :TAX_TYP.MV_LIC_YN := 'N';
  elsif nmbVal = 0 and :TAX_TYP.DR_LIC_YN = 'N' then
     :TAX_TYP.MV_LIC_YN := 'Y';
  elsif nmbVal = 1 and :TAX_TYP.MV_LIC_YN = 'N' then
     :TAX_TYP.DR_LIC_YN := 'Y';
  elsif nmbVal = 1 and :TAX_TYP.MV_LIC_YN = 'Y' then
     :TAX_TYP.DR_LIC_YN := 'N';
  end if;
END;

- Under :TAX_TYP.DR_LIC_YN item, create a WHEN-CHECKBOX-CHANGED trigger with a single line statement below:
SPR_CHECK_VALUES(0);

- And under :TAX_TYP.MV_LIC_YN item, create a WHEN-CHECKBOX-CHANGED trigger with a single line statement below:
SPR_CHECK_VALUES(1);

It should works fine.

 

by: markgeerPosted on 2007-07-26 at 06:03:05ID: 19574002

A "WHEN-CHECKBOX-CHANGED" trigger (by default at least) will work *ONLY* when the user intentionally checks or unchecks the field (like when they create a new record or change an existing record).  This trigger *WILL NOT* be fired automatically though when existing records are queried in the block *UNLESS* you add a POST-QUERY trigger that forces a value into one of these fields.  But, I would not consider that option (a POST-QUERY trigger) the best way to solve the problem, since you probably do not want to force the users to query every record in the table, and unless you add a check in the POST-QUERY trigger to see if one of these is already checked, this trigger may cause more problems (or at least more user annoyance) than it is worth.

I think you first need to do an update of the existing records to set of these two values, then the  "WHEN-CHECKBOX-CHANGED" triggers like prast1007 suggested can take care of every new or changed record from now on.

 

by: VibertHPosted on 2007-07-26 at 06:40:58ID: 19574309

This does the same thing the other code does.  It's applied to only the first row.  Let me try to diagram this with the data (where 'X' is a checkmark).

ID     Description    Basis   Checkbox1   Checkbox2   Checkbox3   MV_LIC_YN     DR_LIC_YN
--     --------------    -------    ------------     ------------    -------------    --------------     ---------------
1      Some desc    None            X                                         X                                            X    
2      Some desc    None            X                                         X                     X                     X
3      Some desc    None            X                                         X                     X                     X
4      Some desc    None                                   X                                         X                     X
5      Some desc    None            X                     X                  X                    X                      X    

This is an exmple of the form when it is loaded.  You can update, insert, and delete from here.  That all works perfectly.  For ID 1 (or row 1), the triggers work fine.  For IDs 2-5, it's not working at all.  It allows for both columns to be checked and it shouldn't.  All rows should behave as row 1.  

 

by: markgeerPosted on 2007-07-26 at 06:49:15ID: 19574382

What triggers do you have on the block and on the two fields: MV_LIC_YN and DR_LIC_YN?

 

by: VibertHPosted on 2007-07-26 at 06:54:17ID: 19574430

markgeer,
I am not trying to get it to fire on load.  I am trying to get it to fire when I check a box.  

ID     Description    Basis   Checkbox1   Checkbox2   Checkbox3   MV_LIC_YN     DR_LIC_YN
--     --------------    -------    ------------     ------------    -------------    --------------     ---------------
1      Some desc    None            X                                         X                                            X    
2      Some desc    None            X                                         X                     X                     X
3      Some desc    None            X                                         X                     X                     X
4      Some desc    None                                   X                                         X                     X
5      Some desc    None            X                     X                  X                    X                      X    

If this loads with both rows checked, that's cool.  But since I just added these two columns to the table, that won't be the case they will be null for every record.  

So let's work with a real exmple.  This is how the table loads.

ID     Description    Basis   Checkbox1   Checkbox2   Checkbox3   MV_LIC_YN     DR_LIC_YN
--     --------------    -------    ------------     ------------    -------------    --------------     ---------------
1      Some desc    None            X                                         X                                                  
2      Some desc    None            X                                         X                                            
3      Some desc    None            X                                         X                                            
4      Some desc    None                                   X                                                                
5      Some desc    None            X                     X                  X                                                

This is what I need for it to do after checking the boxes.  

ID     Description    Basis   Checkbox1   Checkbox2   Checkbox3   MV_LIC_YN     DR_LIC_YN
--     --------------    -------    ------------     ------------    -------------    --------------     ---------------
1      Some desc    None            X                                         X                                            X    
2      Some desc    None            X                                         X                     X                      
3      Some desc    None            X                                         X                                            X
4      Some desc    None                                   X                                         X                      
5      Some desc    None            X                     X                  X                    X                

This is what it actually does.

ID     Description    Basis   Checkbox1   Checkbox2   Checkbox3   MV_LIC_YN     DR_LIC_YN
--     --------------    -------    ------------     ------------    -------------    --------------     ---------------
1      Some desc    None            X                                         X                                            X    
2      Some desc    None            X                                         X                     X                     X
3      Some desc    None            X                                         X                     X                     X
4      Some desc    None                                   X                                         X                     X
5      Some desc    None            X                     X                  X                    X                      X    


THe trigger works only for the first row.  

 

by: VibertHPosted on 2007-07-26 at 06:56:25ID: 19574455

markgeer,
I have WHEN-CHECKBOX-CHANGED for both fields.

 

by: markgeerPosted on 2007-07-26 at 07:05:40ID: 19574538

I should confess that even though I've worked with Oracle Forms for 15 years (since version 2) I rarely use checkboxes, so I don't have much experience with WHEN-CHECKBOX-CHANGED triggers, and I was assuming they would be excuted with the same frequency as a WHEN-RADIO-CHANGED trigger.

Another option that should be very effective, but not quite as user-friendly is a WHEN-VALIDATE-RECORD trigger.  That could easily ensure that only one of this is checked.

 

by: VibertHPosted on 2007-07-26 at 07:20:17ID: 19574673

I am just beginning to work with forms.  How can I use the WHEN-VALIDATE-RECORD trigger?

 

by: markgeerPosted on 2007-07-26 at 10:02:14ID: 19576246

The WHEN-VALIDATE-RECORD trigger is not my favorite since I don't find it as user-friendly as a WHEN-VALIDATE-ITEM trigger (which is what I try use for most validation in Oracle Forms) but the WHEN-VALIDATE-RECORD trigger is very reliable.  It is executed when the user tries to navigate away from or save a new or changed record.  That could easily check to confirm that at least one but not both of the two new checkboxes are checked.

This code in a WHEN-VALIDATE-RECORD trigger should do the job:
 IF :TAX_TYP.MV_LIC_YN = 'Y' THEN
  IF :TAX_TYP.DR_LIC_YN := 'Y' THEN;
    -- Display an alert here with a message like: "Please check either MV_LIC or DR_LIC, but not both."
      raise form_trigger_failure;
  END IF;
ELSE
  IF :TAX_TYP.DR_LIC_YN := 'N' THEN;
    -- Display an alert here with a message like: "Please check either MV_LIC or DR_LIC.."
      raise form_trigger_failure;
  END IF:
END IF:

Note: I usually use a procedure in an attached PLL library to display an alert, and to "raise form_trigger_failure;".  

Here is the text of the procedure "msg_alert" that we put in a PLL library that we attach to all of our forms, so we can call this from any Forms trigger or program unit:

(This does require that you define three alerts with names matching the names in the three "FIND_ALERT..." commands and copy these alerts into all of your forms.)

procedure msg_alert(
errm in char,           /* message */
errt in char,           /* message type */
rftf in boolean         /* raise form_trigger_failure ? */
) is
--
  alert_is alert;
  alert_button number;
--
BEGIN
--        
  IF (errt = 'E')
    THEN alert_is := FIND_ALERT('ALERT_ERROR');
  ELSIF (errt = 'W')
    THEN alert_is := FIND_ALERT('ALERT_WARN');
  ELSIF (errt = 'I')
    THEN alert_is := FIND_ALERT('ALERT_INFO');
  ELSE
    MESSAGE(errm);
  END IF;
--    
  IF errt IN ('E','W','I') THEN
    SET_ALERT_PROPERTY(alert_is,ALERT_MESSAGE_TEXT,errm);
    alert_button := SHOW_ALERT(alert_is);
  END IF;
--
  IF (rftf) THEN
    RAISE FORM_TRIGGER_FAILURE;
  END IF;
--
END;

 

by: prast1007Posted on 2007-07-26 at 18:46:48ID: 19579727

VibertH, it's a little bit ackward that the procedure above only works on the first row. Because I never got the same issue with that, for I have used it on many forms.

If you don't mind, could you just send me the form source code (fmb), so I can take a look at it closer.

Maybe there's something else in it that make the procedure not work/override.

Wish can help you out.
prast@fif.astra.co.id

 

by: VibertHPosted on 2007-07-27 at 05:23:05ID: 19581687

I'm looking at it and will get back to you.

 

by: markgeerPosted on 2007-07-27 at 06:47:37ID: 19582204

You do have the block defined as a database block (not a control block) right?  And you use the default query functionality of Oracle Forms to query that database table (or view) to put multiple records on the screen, right?

Like prast1007, I've never seen a Forms trigger work on only the first record in a block (unless it had logic in it that checked the record number or something).

 

by: VibertHPosted on 2007-07-30 at 09:01:45ID: 19593479

Yeah, it's a data block and I used the wizard to query.

 

by: markgeerPosted on 2007-07-30 at 11:26:34ID: 19594590

OK, the WHEN-CHECKBOX-CHANGED trigger only fires when the user adds or changes a record, *NOT* when a query populates records in the block.  A POST_QUERY trigger would fire at query time for every record retrieved by a query.

But which problem are you trying to solve here?  Are you trying to get one of these two columns selected for all existing records, or do you want the screen to make sure that for new (or changed) records, at least one of these columns gets selected?  Those are two different problems, and will require two different triggers *IF* you want an Oracle Forms to help solve both problems.

 

by: VibertHPosted on 2007-07-30 at 11:59:14ID: 19594836

Ok, what I am trying to do is after the form loads, it will load rows.  At this point, you can check or uncheck boxes for the rows.  For any given row, you can select one of the two columns.  If you add a new row, you can select one of the two columns.  So if I check/uncheck the boxes for the rows, then I am changing the record.  So the WHEN-CHECKBOX-CHANGED should fire.  But it is only firing when I I check/uncheck for the first row.  For the others, it does nothing.

 

by: prast1007Posted on 2007-07-31 at 03:46:00ID: 19599043

Well VibertH,

I'm not cery sure about what is really going on with your form since I don't see it, but maybe it happens because the columns (MV_LIC_YN, DR_LIC_YN) has no default values. Just tried to add something in POST_QUERY trigger in the related data block like this :

IF :MV_LIC_YN is null then
   IF :DR_LIC_YN  is not null then
       if :DR_LIC_YN is in ('Y', 'N') then
           spr_check_values (0);
       else
          /* Define an error message because of :DR_LIC_YN has invalid value ! */
       end if;
   ELSE
       /* just initiate  the proposed value */
      :DR_LIC_YN := 'Y';
      :MV_LIC_YN := 'N';
   END IF;
END IF;
IF :DR_LIC_YN is null then
   IF :MV_LIC_YN  is not null then
       if :MV_LIC_YN is in ('Y', 'N') then
           spr_check_values (1);
       else
          /* Define an error message because of :MV_LIC_YN has invalid value ! */
       end if;
   ELSE
       /* just initiate  the proposed value */
      :DR_LIC_YN := 'Y';
      :MV_LIC_YN := 'N';
   END IF;
END IF;

I assumed that you still have the procedure spr_check_value in your program unit.

 

by: VibertHPosted on 2007-07-31 at 05:49:09ID: 19599827

That does the same thing.  Can I just email you the form and relevant table?

 

by: prast1007Posted on 2007-07-31 at 05:52:33ID: 19599858

Okay then,
Sent me the form along with the table's structure relted with it, And I will try to look at it closely...

Regards,
prast@fif.astra.co.id

 

by: VibertHPosted on 2007-07-31 at 06:02:11ID: 19599939

ok, you should have it.

 

by: prast1007Posted on 2008-08-25 at 19:24:33ID: 22311093

Should I get the credit for this also ?

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...