CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Before Insert Trouble

Print topic Send  topic

Author Message
DrivenTooFar

Posts: 10
Posted: 01/28/2007, 6:48 AM

I am trying to use the Before Insert Event to modify some text before I insert it into the database. What it is supposed to be doing is taking the string and removing anything in it that isn't a number. I'm pretty sure the Formatting function is right but when I try to do the Before Insert command nothing happens. Syntax is fine but it just doesn't Insert anything into the database. Here is the code:

Function frmMain_BeforeInsert(Sender) 'frmMain_BeforeInsert @2-2DE5EEA1

'Custom Code @43-73254650
' -------------------------
Dim strHome, strWork, strOther, strSocial

strHome = frmMain.HomePhoneNumber.Value
strWork = frmMain.WorkPhoneNumber.Value
strOther = frmMain.OtherPhoneNumber.Value
strSocial = frmMain.SocialSecurityNumber.Value

strHome = FormatPhoneNumber(strHome)
strWork = FormatPhoneNumber(strWork)
strOther = FormatPhoneNumber(strOther)
strSocial = FormatPhoneNumber(strSocial)

frmMain.HomePhoneNumber.Value = strHome
frmMain.WorkPhoneNumber.Value = strWork
frmMain.OtherPhoneNumber.Value = strOther
frmMain.SocialSecurityNumber.Value = strSocial
' -------------------------
'End Custom Code

End Function 'Close frmMain_BeforeInsert @2-54C34B28

Does anyone know what I am doing wrong? If you need it, I will post the format function. Thanks.
View profile  Send private message
csierra

Posts: 123
Posted: 01/30/2007, 12:33 PM

Try Sender.OtherPhone.... instead of frmMain.OtherPhone;

change frmMain to Sender
_________________
Yes! I Can!!!
View profile  Send private message

Add new topic Subscribe to topic   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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