Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the Right() and Left() Functions to work in backend code.

Status
Not open for further replies.

heanue

Technical User
May 9, 2000
2
US
I was wondering how, without having a full version of Visual basic on a machine - just having a full version of MS Access installed - I could get functions like Right(), Left(), etc. to function in my backend visual basic code.&nbsp;&nbsp;Basically, I have some code to help adjust some data.&nbsp;&nbsp;It runs when a form button is hit.&nbsp;&nbsp;I want to give it out to people who only have Access installed on their machines, but because it relies on using functions like &quot;Right()&quot;,&nbsp;&nbsp;it doesn't work on machines that just have Access installed.&nbsp;&nbsp;I don't really understand this.&nbsp;&nbsp;I guess I hadn't realized that those functions weren't part of VBA.&nbsp;&nbsp;HOw can I get them to work?<br><br>
 
Your question is confusing. The Right() function does work in VBA.VBA comes with Access, so you don't need a separate Visual Basic install. And why put the code into the back end, when the button would be in your front end? You can change back end data by putting the code in the front end. Also you can use those functions in an update query. Otherwise you can put the functions in code behind form events liek the button's OnClick event in the front end.
 
I'm a little confused too.&nbsp;&nbsp;When you say &quot;backend visual basic code&quot;, do you mean a VB project itself, or Access-VBA code?&nbsp;&nbsp;That is, you're saying a machine without VB installed should be able to run a VB exe--and it should, if you run a Setup program, which will install the libraries that contain Right and Left.&nbsp;&nbsp;But, if they have Access, as Elizabeth said, those functions are available, maybe you just need to check the&nbsp;&nbsp;Project¦References and see that the correct lib is checked.&nbsp;&nbsp;I've had cases where in A-2000, these libs are not checked by default.&nbsp;&nbsp;I'm not even sure which library it is, I think it's MSAccess 8/9.0 ojbect library. <br>--Jim
 
Thanks for replying to my post Jim and Elizabeth.&nbsp;&nbsp;The question was confusing, but you got me to the right answer.&nbsp;&nbsp;I checked the list of libraries under Tools¦References more carefully and noted that &quot;Visual Basic For Applications&quot; was listed three additional times as well as at the top of the list where it was checked.&nbsp;&nbsp;I checked all the listings and, amazingly, the Right() and Left() functions began to work.&nbsp;&nbsp;I have no idea why this is the case, but I got my code to work properly.&nbsp;&nbsp;Thanks.
 
Hmmmph! I went and checked my references and I have 7 repititions of it! What's up, anybody???
 
I may have a similar situation. I just converted the Membership database (created with the database wizard) from Access 97 to 2000, as I couldn't find &quot;membership&quot; in my Office 2000 package. A number of things don't seem to work. In one case, the report &quot;Alphabetical Member Listing&quot; can't seem to find the &quot;left&quot; function. (It's being used to pick up the first character of the last name in order to create a fancy group-break... or so I thought.) I _thought_ that was the &quot;left&quot; the error message (&quot;undefined function 'left' in expression&quot;) referred to, so I removed the code to see if it made a difference. It didn't. So, is there somewhere buried in the muck a reference to &quot;left&quot; that isn't working? If so, how do I get to it?<br><br>I'll try to post elsewhere, but does anyone know why I should get the messsage &quot;compile error... can't find project or library&quot;? The message points to &quot;dim dbs as database&quot; in the module. When I click help, it &quot;helpfully&quot; tells me &quot;A referenced project could not be found or a referenced object libary corresponding to the language of the project could not be found.&quot; Furthermore, the help says <br>to resolve the references, display the References dialog box. Fine, but the tools¦references is greyed out. So, where do I go next with this foolishness?<br><br>Thanks for any help I can get!<br><br>John
 
As you load software to your machine, modifications are made to the Registry.&nbsp;&nbsp;This is where Access gets the list of &quot;Available References&quot;.&nbsp;&nbsp;References include .dll, .ocx, .tlb, etc...<br><br>Some of the files listed, unfortunately, have the same description (different files, same description displayed).<br><br>Under &quot;Visual Basic for Applications&quot; descriptions, I have files...<br><br>VBAEND32.olb, MSVBVM60.dll, MSVBVM50.dll, VBAEN32.olb <br><br>The VB runtime processor looks in these libraries, in the order listed, to resolve unknown references.<br><br>One BIG problem -- If there is a MISSING file checked, the VB runtime will STOP looking when it gets to the missing file!&nbsp;&nbsp;It just reports &quot;not found&quot; instead of continuing to the other libs.<br><br>My suggestion -- Understand which libraries are really needed, and uncheck those that are not being used.&nbsp;&nbsp;&nbsp;&nbsp; <p>Jim Conrad<br><a href=mailto:jconrad3@visteon.com>jconrad3@visteon.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top