Why does not my function work?

hannlapp

Registered User.
Local time
Today, 22:13
Joined
Sep 22, 2011
Messages
12
Hi!

I have Access 2010 in Windows 7 Ent and my function works fine.

Then I have Access 2010 also in Win XP, but my function does not work.

Both files are the same.

Here is the function, but there are many other functions that do not work either. So why?

Not Left([name];2)="B,"

thanks

Hanski
 
There's an excellent chance that the nonfunctional database has Missing references.

I believe this was the same answer I or someone else gave you in a different thread.
 
Hi.

I can not see what reference is wrong because there are no missing references. What reference has influence in functions?

And this in not a question of VBA but pure query. What references are there?

hanski
 
Do you get any errors when you compile? Missing references cause code to error out on the first function that runs even if it is an integral VBA function.
 
What is the rest of the function? Please show all the code.


Typical syntax would be something like

If Not Left([name],2) ="B," Then

Or
If left([name],2) <> "B," then

if it's all in a query
it would be
WHERE Not Left([name],2) ="B,"

or
WHERE left([name],2) <> "B,"

If it's a query show the query SQL

Perhaps you use a semi colon separator in Finish version??
 
What is the rest of the function? Please show all the code.


Typical syntax would be something like

If Not Left([name],2) ="B," Then

Or
If left([name],2) <> "B," then

if it's all in a query
it would be
WHERE Not Left([name],2) ="B,"

or
WHERE left([name],2) <> "B,"

If it's a query show the query SQL

Perhaps you use a semi colon separator in Finish version??

Hi!

This works perfect in windows 7 Finnish version but not at all in win XP finnish version, allthough it is very very simple function!

I converted it to vba and the result is exactly the same. Here is the code:

Private Sub Form_Load()

Dim Con1 As New ADODB.Connection
Dim N1 As New ADODB.Recordset
Set Con1 = CurrentProject.Connection
hae.Open "SELECT dbo_nimet.Nimi FROM dbo_nimet WHERE (((dbo_nimet.poistettu) = False Or (dbo_nimet.poistettu) Is Null) And " & _
"((dbo_nimet.kesätyöntekijä) = False Or (dbo_nimet.kesätyöntekijä) Is Null)) and not left(dbo_nimet.nimi,2)= 'B,' " & _
"ORDER BY dbo_nimet.Nimi", putki, adOpenDynamic, adLockOptimistic
End Sub

Do not mind the field names because they are finnish:)

I got error message:
Run-time error '-2147217900 (800040e14)'
Function is no available in query ...and so on...
 
Have you tried a very simple query as a test?

In the query sql window try

SELECT dbo_nimet.Nimi
FROM dbo_nimet
WHERE
left(dbo_nimet.nimi,2)= 'B,'"


Also you have an extra space after the last ' and before " in your SQL.
 

Users who are viewing this thread

Back
Top Bottom