CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 ASP Question

Print topic Send  topic

Author Message
Paul
Posted: 06/12/2001, 9:52 AM

I hope this isn't to far off topic. It involves CC but the fact is I don't
know the ASP code to accomplish what I want to do with or without CC. So
here goes....

I have an Insert/Update Form that contains several fields but the question
only involves two. Those two fields are SSN (Social Security Number) and
CaseNum (Case Number).

The CaseNum is made up from the last four digits of the SSN. On the form
CaseNum is a hidden field that is filled before insert.

What I want to do is Unhide the CaseNum field, if there is any duplicate
CaseNum found, so that the value can be edited. An example would be if the
CaseNum is "1234" and "1234" already existed an error would be triggered and
the field would be made available so the user could put an alpha character
as a suffix to the duplicate field making it "1234A".

Any suggestions as to how I could accomplish this, or any alternative
suggestions for accomplishing the samething would be greatly appreciated.

Paul









Frank Rocco
Posted: 06/12/2001, 12:42 PM

Paul,

I'm a newbie, but I don't see on you can do this in CodeCharge without
editing the ASP file directily. Here is some code that will not show the
input box if you set duplicate to true.

HTH

Frank

<HTML>
<HEAD></HEAD>
<BODY>
<form action="Doit" method=post Name="MyForm">
<%
case_id = 123
duplicate = false

if duplicate = false then
%>
<p>Case id
<INPUT type="text" name=text1 size=30></p>
<% end if %>

<INPUT NAME="Submit" TYPE=Submit Value="Submit"><INPUT NAME="Reset"
TYPE=Reset Value="Reset">
</FORM>
</BODY>
</HTML>

Dr. Scott R. Senay
Posted: 06/12/2001, 6:06 PM

I think the simplest thing to do is just use the entire social security
number, those are ALREADY unique so there is no fear of a duplicate, why do
more work than you need to?

You could also have some after insert code that would validate the field and
automatically append and alpha character to the field.

Scott...


Paul <paporter@visto.com> wrote in message
news:9g5hci$hef$1@mail.tankhill.com...
> I hope this isn't to far off topic. It involves CC but the fact is I
don't
> know the ASP code to accomplish what I want to do with or without CC. So
> here goes....
>
> I have an Insert/Update Form that contains several fields but the question
> only involves two. Those two fields are SSN (Social Security Number) and
> CaseNum (Case Number).
>
> The CaseNum is made up from the last four digits of the SSN. On the form
> CaseNum is a hidden field that is filled before insert.
>
> What I want to do is Unhide the CaseNum field, if there is any duplicate
> CaseNum found, so that the value can be edited. An example would be if
the
> CaseNum is "1234" and "1234" already existed an error would be triggered
and
> the field would be made available so the user could put an alpha character
> as a suffix to the duplicate field making it "1234A".
>
> Any suggestions as to how I could accomplish this, or any alternative
> suggestions for accomplishing the samething would be greatly appreciated.
>
> Paul
>
>
>
>
>
>
>
>
>
>

Paul
Posted: 06/13/2001, 5:42 AM

If I had that option there wouldn't be a problem. This is not my decision
to make.

Dr. Scott R. Senay wrote in message <9g6ea5$cfp$1@mail.tankhill.com>...
>I think the simplest thing to do is just use the entire social security
>number, those are ALREADY unique so there is no fear of a duplicate, why do
>more work than you need to?
>
>You could also have some after insert code that would validate the field
and
>automatically append and alpha character to the field.
>
>Scott...
>
>
>Paul <paporter@visto.com> wrote in message
>news:9g5hci$hef$1@mail.tankhill.com...
>> I hope this isn't to far off topic. It involves CC but the fact is I
>don't
>> know the ASP code to accomplish what I want to do with or without CC. So
>> here goes....
>>
>> I have an Insert/Update Form that contains several fields but the
question
>> only involves two. Those two fields are SSN (Social Security Number) and
>> CaseNum (Case Number).
>>
>> The CaseNum is made up from the last four digits of the SSN. On the form
>> CaseNum is a hidden field that is filled before insert.
>>
>> What I want to do is Unhide the CaseNum field, if there is any duplicate
>> CaseNum found, so that the value can be edited. An example would be if
>the
>> CaseNum is "1234" and "1234" already existed an error would be triggered
>and
>> the field would be made available so the user could put an alpha
character
>> as a suffix to the duplicate field making it "1234A".
>>
>> Any suggestions as to how I could accomplish this, or any alternative
>> suggestions for accomplishing the samething would be greatly appreciated.
>>
>> Paul
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>

Paul
Posted: 06/13/2001, 6:21 AM

I see where your going Frank and that might be an option. I'm having
trouble finding where CC is handleing the "No Duplicate" Error. If I can
figure out how that event is fired what I'd really like to do is handle the
whole thing without user interaction at all. Using something like:

If len(CaseNum) = 4 then
CaseNum = CaseNum + "A"
else
Sufx = Asc(Right(CaseNum),1) + 1
CaseNum = Left(CaseNum,4) + Chr(Sufx)
end if

I'm just hacking this out so it might be buggie but you get the idea. This
way the end user never has to worry about it at all.

My problems with this is that (A.) I don't know how the CC is discovering
the error and the associated error code that is being generated. (B.) After
the code event is fired how do I direct the program to the code above. (C.)
After the code above is executed how do I have the page continue the
"Insert" process that was start before discovery of the error?

Like I said I'm really lost at this point. I've found the way the
validation errors are handled but they are discovered before "Submit" is
executed. This error, I believe, is genereated once the database is hit and
it is determined that a duplicate value exists; and that is what I don't
know how to handle.

Thanks for the input;

Paul

I'd do that by checking the length of CaseNum if it's length is 4 then
append "A" to the end other wise use chr(right(CaseNum,1))
Frank Rocco wrote in message <9g5rb1$r2r$1@mail.tankhill.com>...
>Paul,
>
>I'm a newbie, but I don't see on you can do this in CodeCharge without
>editing the ASP file directily. Here is some code that will not show the
>input box if you set duplicate to true.
>
>HTH
>
>Frank
>
><HTML>
><HEAD></HEAD>
><BODY>
><form action="Doit" method=post Name="MyForm">
><%
>case_id = 123
>duplicate = false
>
>if duplicate = false then
>%>
><p>Case id
><INPUT type="text" name=text1 size=30></p>
><% end if %>
>
><INPUT NAME="Submit" TYPE=Submit Value="Submit"><INPUT NAME="Reset"
>TYPE=Reset Value="Reset">
></FORM>
></BODY>
></HTML>
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.