1

Topic: Syntax error

Help to find an error in update query.

, SCRINING_DATA_NAZNACHENO = "AND FormatSpDate (rst (" SCRINING_DATA_NAZNACHENO ")) AND"

Here so

CurrentDb. Execute "Update SPR_SCRINING_TIPS_TBL SET SCRINING_PRIMENITb =" AND rst ("PRIMENITb") AND "where SCRINING_KOD =" AND rst ("SCRINING_KOD")

Errors are not present
------------------------------------------------------------------------
Thanks for the answer.

2

Re: Syntax error

And here so the error is

CurrentDb. Execute "Update SPR_SCRINING_TIPS_TBL SET SCRINING_PRIMENITb =" AND rst ("PRIMENITb") AND ", SCRINING_DATA_NAZNACHENO =" AND FormatSpDate (rst ("SCRINING_DATA_NAZNACHENO")) AND "where SCRINING_KOD =" AND rst ("SCRINING_KOD")

In what an error? Specify.

3

Re: Syntax error

58, FormatSpDate
It is possibly user function - can in it that?

4

Re: Syntax error

alecko, yes  the especial;

Public Function FormatSpDate (ByVal parDate As Date, Optional bSQL As Boolean = False) As String
On Error Resume Next
FormatSpDate = Format $ (parDate, "\#mm\/dd\/yy\#")

And simply date not .

5

Re: Syntax error

58 wrote:

And here so the error is

CurrentDb. Execute "Update SPR_SCRINING_TIPS_TBL SET SCRINING_PRIMENITb =" AND rst ("PRIMENITb") AND ", SCRINING_DATA_NAZNACHENO =" AND FormatSpDate (rst ("SCRINING_DATA_NAZNACHENO")) AND "where SCRINING_KOD =" AND rst ("SCRINING_KOD")

In what an error? Specify.

CurrentDb. Execute "Update SPR_SCRINING_TIPS_TBL SET SCRINING_PRIMENITb =" AND rst ("PRIMENITb") AND ", SCRINING_DATA_NAZNACHENO = #" AND FormatSpDate (rst ("SCRINING_DATA_NAZNACHENO")) AND "# where SCRINING_KOD =" AND rst ("SCRINING_KOD")
Public Function FormatSpDate (ByVal parDate As Date, Optional bSQL As Boolean = False) As String
On Error Resume Next
FormatSpDate = Format $ (parDate, "mm\/dd\/yy")

6

Re: Syntax error

58 wrote:

yes  especial

Generally on normal function at first test, at least the button c MsgBox and emergency reset should be provided, at you as it and does not smell...

Public Function FormatSpDate (ByVal parDate As Date, Optional bSQL As Boolean = False) As String
FormatSpDate = "Kirdyk!"
On Error GoTo er1
'......
'...... Here operators in whom there can be errors
'.......
FormatSpDate = "Real necessary correct value"
Exit Function
er1:
End Function

7

Re: Syntax error

Function returns (if returns) the text. Accordingly inverted commas need to be added.
The field [SCRINING_DATA_NAZNACHENO] is a text?

CurrentDb. Execute "Update SPR_SCRINING_TIPS_TBL SET SCRINING_PRIMENITb =" AND rst ("PRIMENITb") AND ", SCRINING_DATA_NAZNACHENO ="""AND FormatSpDate (rst ("SCRINING_DATA_NAZNACHENO")) AND"""where SCRINING_KOD =" AND rst ("SCRINING_KOD")

8

Re: Syntax error

alecko;
Yes, precisely.
Put so-called.

9

Re: Syntax error

vmag;
It is a slice from function what to show that there in it becomes...
And .

10

Re: Syntax error

58 wrote:

It is a slice from function what to show that there in it becomes...
And .

On Error Resume Next and this line it is already enough to draw an output...

11

Re: Syntax error

vmag;
:-(
----------
:-)