473,388 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

decrypting problem - dont get scared by the title

i have a form that i will be using when the user opens a report that asks the user if they want to decrypt social security numbers stored in the database or not. the module to do the encrypting/decrypting works perfectly, but when i try and apply it to the form on a command button (labeled "yes"), it gives me a VB runtime error - "Run-time error '424': Object required". i have the code below - i am using MS Access 2003. as always, i appreciate any help i can get. (if i don't answer, that is only because i will be out of the office for one month and i will check when i get back. thanks again)

CODE

Private Sub decrypty_Click()
Dim stDocName As String

stDocName = "_RPT_addresslist"

'decrypt first
Me!SSN = CipherSSN(employee!SSN)

'open report showing ss#
DoCmd.OpenReport stDocName, acPreview

End Sub

END CODE

where CipherSSN is the module name, employee is the table where the SSN is encrypted and stored, me is the report referencing itself, and me!ssn is the report referencing the ssn text box on the report.
Jul 25 '07 #1
11 1605
missinglinq
3,532 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. Private Sub decrypty_Click()
  2.  Dim stDocName As String
  3.  
  4.  stDocName = "_RPT_addresslist"
  5.  
  6.  'decrypt first
  7.      Me!SSN = CipherSSN(employee!SSN)
  8.  
  9.  'open report showing ss#
  10.       DoCmd.OpenReport stDocName, acPreview
  11.  
  12.  End Sub
If CipherSSN is, indeed, a Module name, why are you using it like a Function

Me!SSN = CipherSSN(employee!SSN)

in Line # 7of your code? If both your Function and the Module that holds it have the same name, that is probably the source of your problem; this is not allowed by Access.

Linq ;0)>
Jul 25 '07 #2
Rabbit
12,516 Expert Mod 8TB
You can get table values that way. And I don't think you can change textbox values in a report.

Try Me!SSN = CipherSSN(Me!SSN)
Jul 25 '07 #3
sorry about that, its a typo...the module name is cssn and the function name is CipherSSN ... very hectic today as its my last day.
Jul 25 '07 #4
Rabbit
12,516 Expert Mod 8TB
I can't tell if this means you've solved the problem.
Jul 25 '07 #5
You can get table values that way. And I don't think you can change textbox values in a report.

Try Me!SSN = CipherSSN(Me!SSN)

i tried that and i got VB run-time error 2465: "Microsoft Office Access can't find the field 'SSN' referred to in your expression."

the SSN is being pulled from a query that queries the employee table (where the encrypted SSN is stored) and the report has a textbox on it that has a control source of "ssn" off of the query.

all i want the code to do is decrypt the SSN back to a normal 9-digit's and show the normal one in the report. if i can get that working then i can worry about other stuff on my own.

the purpose of the query is to only pull the desired info off of the employee table and put it in the report.
Jul 25 '07 #6
I can't tell if this means you've solved the problem.

problem NOT solved :)
Jul 25 '07 #7
Rabbit
12,516 Expert Mod 8TB
i tried that and i got VB run-time error 2465: "Microsoft Office Access can't find the field 'SSN' referred to in your expression."

the SSN is being pulled from a query that queries the employee table (where the encrypted SSN is stored) and the report has a textbox on it that has a control source of "ssn" off of the query.

all i want the code to do is decrypt the SSN back to a normal 9-digit's and show the normal one in the report. if i can get that working then i can worry about other stuff on my own.

the purpose of the query is to only pull the desired info off of the employee table and put it in the report.
You'll have to decrypt the SSN from the query then.
Jul 25 '07 #8
You'll have to decrypt the SSN from the query then.
assistance? example code?
Jul 25 '07 #9
Rabbit
12,516 Expert Mod 8TB
In a normal code module you'll have something along the lines of:

Expand|Select|Wrap|Line Numbers
  1. Public Function CipherSSN(strSSN As String) As String
  2.   ...
  3. End Function
Correct?

In your query it would be something along the lines of:

Expand|Select|Wrap|Line Numbers
  1. SELECT CipherSSN(TableName.SSN) As Expr1 FROM TableName;
  2.  
Jul 25 '07 #10
In a normal code module you'll have something along the lines of:

Expand|Select|Wrap|Line Numbers
  1. Public Function CipherSSN(strSSN As String) As String
  2.   ...
  3. End Function
Correct?

In your query it would be something along the lines of:

Expand|Select|Wrap|Line Numbers
  1. SELECT CipherSSN(TableName.SSN) As Expr1 FROM TableName;
  2.  
finally! thank you very much. this will certainly help relieve some stress on my vacation:) thanks again
Jul 25 '07 #11
Rabbit
12,516 Expert Mod 8TB
Not a problem, good luck.
Jul 25 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Alessandro Bottoni | last post by:
I know you will shake you head sadly but... I really have to perform such a suicidal task (even if for a short time and just for internal use). I have to send by email (over the open internet) a...
2
by: jimbo_vr5 | last post by:
Hey I think i've figured out the idea behind apply-templates. But going through the tutorial on <http://www.w3schools.com/xsl/xsl_apply_templates.asp> theres simply just something that i dont...
3
by: JW | last post by:
I can encrypt the contents of a memory stream with no problems, however when decrypting( I'm using the same key an IV ) I get an exception stating bad data. I'm at a lost. I'm actually creating...
0
by: cmrchs | last post by:
Hi, Using the RSA-crypto algorithm in .NET , when actually encrypting/decrypting, all the code samples I ran into always used something like, to encrypt : // create keypair and store in...
3
by: VB Programmer | last post by:
I have my SQL Server connectionstring in my web.config file. I'm scared that someone will open the file and get my username/password. How do I encrypt, then decrypt the connection string in the...
19
by: so many sites so little time | last post by:
the table is head the colunm is called body <?php //show_site.php // This script retrieves blog entries from the database. // Address error handing. ini_set ('display_errors', 1);...
5
by: Harb247 | last post by:
Hi Guys, First Post. Need some help decrypting a String / DB The company i manage recently had an argument with their lead programmer for their data base. However he has decided to have nothing...
4
by: Fritjolf | last post by:
Hi. I've got a strange problem... I've made a simple program to test encryption/decryption. I use Rijndael encryption and here are the most important properties. RijndaelManaged cipher =...
2
by: prasath03 | last post by:
Hi, I wrote a java program for Encrypt and Decrypt the given string, when i execute the program it show me an error....but the string has Encrypted, if i want to Decrypt the string it show me an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.