Avatar of Jegajothy vythilingam
Jegajothy vythilingam
Flag for United States of America asked on

Access 2016 VB code

My OS is win 10 pro 64 bit and I have Office 365 and Access 2016 installed on my desktop.  I created a small password creator, which works very well.  But I am trying to implement a search function, and this does not seem to work.  I copied the code from a 2007 sample app.  
Basically,  I would open the Form: frmSearch.  Where there is a field "Select field to Search:", and in the field I would select the field of the table to  search criteria, eg: URL or site.  The field is a combo field with a drop down arrow, to allow me to select the field from the Table : tblMainPasswordTable.  I normally select the field URL or site.
In the "Search for" field, which is unbound field, I would type the search criteria, eg; Office.
And then select the option box " Any part of field" , and then hit the View Results button.
This would open the Form, frmPwd to display the selected criteria and display the results from the table : tblMainPasswordTable.  

But the code is not working, it does not display the correct record for the search criteria.  and at times it bombs at the line : Open Args
Attached is the visual basic source code of the app, and hope the Experts could please let me know where I goofed, as my experience in VB is only at the 2007 level. Thank u and Regards.
Search-code.txt
Microsoft OfficeMicrosoft AccessVisual Basic ClassicVB ScriptSQL

Avatar of undefined
Last Comment
Hamed Nasr

8/22/2022 - Mon
Anastasia D. Gavanas

Try to set the Me.OpenArgs to the proper form
For Example Forms!PsswEntry.OpenArgs
Antonio Salva Ripoll

Hi.

Please, can you attach the database file?, reading the code is useful, but see how you call the code procedures and the forms is much better, beacause we can understand what the code does really.

Thanks.

Best regards.

Antonio.
Jegajothy vythilingam

ASKER
I cannot seem to attach a Access file either in 2016 or 2002-2003 versions.  How do I upload the file which is in 2016.
thank u
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Hamed Nasr

Try to compress (zip) the file.
Other option, add dot txt (.txt) at end of file.
Jegajothy vythilingam

ASKER
Thank u hnasr for the solution how to load the file.  Here it is as a txt file, but u would have to change the extension to an accdb once u have unzipped it.  Thank u.
TestforEE.txt
ASKER CERTIFIED SOLUTION
Hamed Nasr

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jegajothy vythilingam

ASKER
in response to hnasr, Bravo for correcting the code, the application now works fine as it was planned for.  Thank u again.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Jegajothy vythilingam

ASKER
Bravo, for correcting the code and righting the application.  Thank u.
Hamed Nasr

Welcome!