473,785 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2145
Access will give these errors if any reference is broken, not just the VBA
one.

Not sure what you mean by "disconnect ing" 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********@Ver satel.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
7240
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 mde, backend is mdb -only occurs on the production server -only occurs with mde verson - i've tested the problem with the mdb version of the front-end and it loads/generates the document fine on the production
1
4867
by: Simon | last post by:
Dear reader, Some times I receive an error message by using the functions: Left(;2) Mid(;5;2)
1
1303
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 library, which was not indicated as broken, the command Mid(;3;2) works correct.
4
2734
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) SELECT TABLE_NAME_MASTER.F2 AS SRCE_APP_VERSION, TABLE_NAME_MASTER.F3 AS CUST_ID, sys_sysobjects.name AS TABLE_NAME, sys_syscolumns.name AS COLUMN_NAME, sys_syscolumns.colid AS COLUMN_ID, switch( dbo_PSKEYDEFN.KEYPOSN IS NULL,0,999,...
6
10569
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). Seperately the posting words fine but when I want to create one multipart message with both then things go wrong. The binary file is converted and of datatype byte() The xml file is just a string.
1
1478
by: prakz | last post by:
<% ' ------------------------------------------------------------------------------ ' Container of Field Properties Class clsField Public FileName Public ContentType Public Value Public FieldName Public Length Public BinaryData
3
1891
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 "My Text " and exverything left of it, I can use Left(Fieldname, 9) I want something more like this: Left(Fieldname, ) Sometimes there will be text left of "My Text", sometimes not.
4
3661
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 XmlSerializer(typeof(ImportRecord));
2
2339
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 in the edit_subject.php page. I dont know whats wrong with the query i;v had. <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php if (intval($_GET) == 0) {
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10087
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8971
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.