Two common reasons.
The first is that you've used Left somewhere else in your database: a field
in a table, a control on a form, or something like that. Left is a reserved
word, and should never be used in anything you created in the database.
The other possibility is that your references are messed up.
This can be caused by differences in either the location or file version of
certain files between the machine where the application was developed, and
where it's being run (or the file missing completely from the target
machine). Such differences are common when new software is installed.
On the machine(s) where it's not working, open any code module (or open the
Debug Window, using Ctrl-G, provided you haven't selected the "keep debug
window on top" option). Select Tools | References from the menu bar. Examine
all of the selected references.
If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.
If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)
For far more than you could ever want to know about this problem, check out
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
matejp said:
Hi,
it's me again. I've looked around the groups for an answer on why the
left function does not work. I've even located it on the Microsoft
help. The correct syntax should be (as you've written it)
=Left([ProductName], 1) where ProductName should be the name of the
text field on the form. However, once I type that expression in the
control source a dialog box pops up saying "The expression you entered
contains invalid syntax." and below that "You omitted an operand or
operator, you entered an invalid character or comma, or you entered
text without surrounding it in quotation marks."
I simply don't know what to do. Since I've just copied and pasted the
code it should work, but it doesn't.
Does anyone know how to solve this?
Thanks for all your help,
matej
"Arvin Meyer" <
[email protected]> wrote in message
It's called parsing. In VB or VBA, you can use the Left(), Right(), and
Mid() functions to parse. So your functions in a query might look something
like this:
Field1: Left([YourField], 1)
Field2: Mid([YourField], 2, 1)
Field3: Mid([YourField], 3, 2)
Field4: Mid([YourField], 4, 3)
...
Field12: Right([YourField], 1)
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
Hi,
I have a text field in format 000123456789 and I have to split this
text field into 12 separate text fields. So this would have to look
something like this:
Field1 has a value 0,
Field2 has a value 0,
Field3 has a value 0,
Field4 has a value 1,
Field5 has a value 2,
Field6 has a value 3,
Field7 has a value 4,
Field8 has a value 5,
Field9 has a value 6,
Field10 has a value 7,
Field11 has a value 8,
Field12 has a value 9.
I have to admit that I don't have a slightest clue on how to achieve
this and would really appreciate help. The reason I have to separate
this field is because I have to multiply each number inside the field
with a different ponder in order to calculate a control number for my
reports.
Thanks for your help,
Matej