473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Error message by Mid([FieldName],3,2)

Dear reader,

The following functions gives me some problems: Mid([FieldName],3,2) and
Left() and Date(). On one pc it works perfect and on the other one an error
message pop's up "Not a valid instruction". After a disconnecting and than
reconnecting a VBA library, which was not indicated as broken, the command
Mid([FieldName];3;2) works correct.

It looks like a check on broken references is not enough.

Who knows how I can avoid this errors in the Left(), Mid() en Right()
instruction.

Thanks for any help,

Simon
Oct 26 '06 #1
1 2134
Access will give these errors if any reference is broken, not just the VBA
one.

Not sure what you mean by "disconnecting" the VBA library. It can't be
deselected as a reference in an Access database.

Unregistering it and re-registering it (and the other libraries you are
using) with Windows might help. Use regsvr32. Details:
http://allenbrowne.com/ser-38.html

The problem could also be caused by an ambiguity, e.g. if there is some
other object named Mid. If this is the cause, you may be able to work around
it by explicitly referring to the VBA library in your code, e.g.:
MyVariable = VBA.Mid([FieldName],3,2)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Simon" <Sv********@Versatel.nlwrote in message
news:45**********************@news.tele2.nl...
Dear reader,

The following functions gives me some problems: Mid([FieldName],3,2) and
Left() and Date(). On one pc it works perfect and on the other one an
error
message pop's up "Not a valid instruction". After a disconnecting and than
reconnecting a VBA library, which was not indicated as broken, the command
Mid([FieldName];3;2) works correct.

It looks like a check on broken references is not enough.

Who knows how I can avoid this errors in the Left(), Mid() en Right()
instruction.

Thanks for any help,

Simon

Oct 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: astro | last post by:
Anyone have suggestions on where to troubleshoot this error? Background: -Access 2k v. 9.0.6926 sp3 - front and backend on production server (wiindows 2k) -accessed via Citrix -front-end is...
1
by: Simon | last post by:
Dear reader, Some times I receive an error message by using the functions: Left(;2) Mid(;5;2)
1
by: Simon | last post by:
Dear reader, If there is now broken reference in the VBA library and I run the code Mid(;3;2) an error massage can by pop's up "Not a valid instruction". After a reconnection of the...
4
by: phytorion | last post by:
i'm working in access2003 trying to bring three large tables(sys_sysobjects, sys_syscolumns, and dbo_pskeydefn) into one table filtered on by fieldname of a fourth table(table_name_master) ...
6
by: fnoppie | last post by:
Hi, I am near to desperation as I have a million things to get a solution for my problem. I have to post a multipart message to a url that consists of a xml file and an binary file (pdf)....
1
by: prakz | last post by:
<% ' ------------------------------------------------------------------------------ ' Container of Field Properties Class clsField Public FileName Public ContentType Public Value Public...
3
by: rando1000 | last post by:
What syntax can I use to vary the location Mid and Left start at based on a text string? Fox example, if I have a field called "Fieldname", with data "My Text is in this field", and I want to remove...
4
by: ink | last post by:
Hi All I am relatively new to doing this and i think that i am making some king of school boy error. The error i am getting is on the following line of code. XmlSerializer xs = new...
2
by: benicio | last post by:
The subject update failed. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = 6' at line 5. This is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.