A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 09:39 PM
MJV
external usenet poster
 
Posts: n/a
Default 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  
Old May 26th, 2004, 04:00 AM
ChrisJ
external usenet poster
 
Posts: n/a
Default 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  
Old May 26th, 2004, 03:56 PM
MJV
external usenet poster
 
Posts: n/a
Default 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  
Old May 26th, 2004, 04:35 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default 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  
Old May 26th, 2004, 07:21 PM
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.