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_addressli st"
'decrypt first
Me!SSN = CipherSSN(emplo yee!SSN)
'open report showing ss#
DoCmd.OpenRepor t 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.
11 1653 - 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
If CipherSSN is, indeed, a Module name, why are you using it like a Function
Me!SSN = CipherSSN(emplo yee!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)> Rabbit 12,516
Recognized Expert Moderator MVP
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!SS N)
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.
Rabbit 12,516
Recognized Expert Moderator MVP
I can't tell if this means you've solved the problem.
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!SS N)
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.
I can't tell if this means you've solved the problem.
problem NOT solved :)
Rabbit 12,516
Recognized Expert Moderator MVP
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.
You'll have to decrypt the SSN from the query then.
assistance? example code?
Rabbit 12,516
Recognized Expert Moderator MVP
In a normal code module you'll have something along the lines of: - Public Function CipherSSN(strSSN As String) As String
-
...
-
End Function
Correct?
In your query it would be something along the lines of: -
SELECT CipherSSN(TableName.SSN) As Expr1 FROM TableName;
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 XML file containing
_system commands_ (yes: the kind of stuff like "rm -dfr /") to a server and
have a Python program sitting on this server, fetching and parsing the
e-mail message and executing the commands (maybe with _root privileges_).
Of...
|
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 get! In the following i've copy pasted the
example from <http://www.w3schools.com/xsl/xsl_apply_templates.asp>
into this post. I divide into sections and my real question will come
after the code snippet:
|
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 a new memory stream, filling it with
the encrypted bytes then trying to read from the crypto stream object. I
have used the same approach encrypting to a file handle and then decrypting
from the same file and it works.
|
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 container
CspParameters param = new CspParameters();
param.KeyContainerName = "NewKeyContainer";
param.Flags = CspProviderFlags.UseMachineKeyStore;
RSACryptoServiceProvider rsaObj = new
RSACryptoServiceProvider(param);
|
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 web.config file?
| |
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);
error_reporting (E_ALL & ~E_NOTICE);
// Connect and select.
|
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 to do with the company so i cannot contact him to get the info i require.
Ive looked over his computer and accessed the .dat (I have no idea why its a .dat file) file using the password however when i open it up in Access i can view the data with...
|
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 = new RijndaelManaged();
cipher.KeySize = 256;
cipher.BlockSize = 256;
|
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 error...
The error is:
javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
Encoded: --> pLqxYQViK5U
Decoded: --> null
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |