If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Access
I have a database built and I have a line of code to go
out and get the first two numbers typed in. I am useing the code like this Private Sub TxtEnter_AfterUpdate() Dim AnyString, MyStr AnyString = TxtEnter ' Define string. If AnyString Then MyStr = left(AnyString, 2) + "000" ' Returns "2". txtSubAddress = MyStr End If End Sub Well it works fine till I try it on another system. I get a error and LEFT it highlighted. Anyone have a clue? |
#2
|
|||
|
|||
Access
this is usually a references problem.
On your good system open the code window (alt-F11),select tools - references. Select each in turn, not the path and filename, and the order in which they appear in the list. Go find each file in explorer, and note its version number. Repeat the same exercise on the bad machine. Check the order first, then make sure that none are missing, finally repeat the version exercise. -----Original Message----- I have a database built and I have a line of code to go out and get the first two numbers typed in. I am useing the code like this Private Sub TxtEnter_AfterUpdate() Dim AnyString, MyStr AnyString = TxtEnter ' Define string. If AnyString Then MyStr = left(AnyString, 2) + "000" ' Returns "2". txtSubAddress = MyStr End If End Sub Well it works fine till I try it on another system. I get a error and LEFT it highlighted. Anyone have a clue? . |
#3
|
|||
|
|||
Access
Thanks for the info.
I thought that was it but still a no go! I have checked version and also setup a fix.BAT file to transfer the file to the location on the PC. I aslo checked references and got them to match up. All are loaded. I looked at the system files and all are loaded. References VBA, Access, stdole, ADODB, PdfLib Current user Admin Jet version 4.0 Still errors on the LEFT statment in the code. Still lost for ideas. -----Original Message----- this is usually a references problem. On your good system open the code window (alt- F11),select tools - references. Select each in turn, not the path and filename, and the order in which they appear in the list. Go find each file in explorer, and note its version number. Repeat the same exercise on the bad machine. Check the order first, then make sure that none are missing, finally repeat the version exercise. -----Original Message----- I have a database built and I have a line of code to go out and get the first two numbers typed in. I am useing the code like this Private Sub TxtEnter_AfterUpdate() Dim AnyString, MyStr AnyString = TxtEnter ' Define string. If AnyString Then MyStr = left(AnyString, 2) + "000" ' Returns "2". txtSubAddress = MyStr End If End Sub Well it works fine till I try it on another system. I get a error and LEFT it highlighted. Anyone have a clue? . . |
#4
|
|||
|
|||
Access
"MJV" wrote in
: Private Sub TxtEnter_AfterUpdate() AnyString = TxtEnter ' Define string. If AnyString Then MyStr = left(AnyString, 2) + "000" ' Returns "2". txtSubAddress = MyStr End If End Sub Well it works fine till I try it on another system. I get a error and LEFT it highlighted. This is a references problem:- the first thing to do is to check that the required libraries are there, as you have already done. The other thing to do is to check the _entire_ list of references in the dialog and see if _anything_ is missing, even one you do not need. If there is, you should remove it; locate the file and re-create the reference later if are likely to need it in the future. This is a recognised bug in Access, that _any_ missing reference is liable to mess up built-in VBA functions. PS Dim AnyString, MyStr This defines two Variants not two strings. You might be better off using Dim AnyString As String Dim MyStr As String as a good habit. BoL Tim F |
#5
|
|||
|
|||
Access
Thank you Chris and Tim,
It works great now. I changed this Dim AnyString, MyStr to Dim AnyString As String Dim MyStr As String and updated the references and got rid of the trash. Thanks for the help! Mike -----Original Message----- "MJV" wrote in : Private Sub TxtEnter_AfterUpdate() AnyString = TxtEnter ' Define string. If AnyString Then MyStr = left(AnyString, 2) + "000" ' Returns "2". txtSubAddress = MyStr End If End Sub Well it works fine till I try it on another system. I get a error and LEFT it highlighted. This is a references problem:- the first thing to do is to check that the required libraries are there, as you have already done. The other thing to do is to check the _entire_ list of references in the dialog and see if _anything_ is missing, even one you do not need. If there is, you should remove it; locate the file and re-create the reference later if are likely to need it in the future. This is a recognised bug in Access, that _any_ missing reference is liable to mess up built-in VBA functions. PS Dim AnyString, MyStr This defines two Variants not two strings. You might be better off using Dim AnyString As String Dim MyStr As String as a good habit. BoL Tim F . |
Thread Tools | |
Display Modes | |
|
|