Cannot find input table or query ". error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I try to run the following, I get the MS Jet database cannot find the
input table or query ". Make sure it exists etc. error

Can anyone point out my mistake to me?

Dim MKT As String
Dim AGRP As String
Dim AENO As Integer

'**NEW HAS THREE POSSIBLE STATES - 0 WHEN FORM IS OPENED, 1 WHEN NEW
RECORD, 2 WHEN EXISTING RECORD
If Me.WDNEW = 2 Then
'UPDATE RECORD
MKT = "WD"
AGRP = "7"
AENO = Me![Text9]

'Call update_sql(MKT, AGRP, AENO)
Dim SSQL1
SSQL1 = "UPDATE tblFUTURE_AUDITS SET
tblFUTURE_AUDITS.intFULL_SCOPE_HRS = ME." & MKT & "_FULL_HRS," & _
"tblFUTURE_AUDITS.intLTD_SCOPE_HRS = me." & MKT & "_LTD_HRS , " & _
"tblFUTURE_AUDITS.intSOX_404_HRS = me." & MKT & "_SOX_HRS, " & _
"tblFUTURE_AUDITS.intFULL_SCOPE_IT = me." & MKT & "_FULL_IT, " & _
"tblFUTURE_AUDITS.intLTD_SCOPE_IT = me." & MKT & "_LTD_IT, " & _
"tblFUTURE_AUDITS.intSOX_404_IT = me." & MKT & "_sox_it, " & _
"tblFUTURE_AUDITS.intCONTINUOUS_AUD_HRS = me." & MKT & "_ca_hrs, " & _
"tblFUTURE_AUDITS.intOTHER = me." & MKT & "_other " & _
"WHERE [txtAUDIT_ENTITY_NO] = " & AENO & " AND TXTAUDGRP = " & "'" & AGRP &
"'"
MsgBox SSQL1

CurrentDb.Execute SSQL, dbfailonerror
 
"CurrentDb.Execute SSQL, dbfailonerror "

Your querystring variable is called "SSQL1", but you're executing "SSQL"
 
So, I suppose there are two morals to this story:

Check your code; and
Don't program when taking cold medication.

Thanks Bagger
--
Ficticiously Yours, Biggles


Bagger said:
"CurrentDb.Execute SSQL, dbfailonerror "

Your querystring variable is called "SSQL1", but you're executing "SSQL"

Biggles said:
When I try to run the following, I get the MS Jet database cannot find the
input table or query ". Make sure it exists etc. error

Can anyone point out my mistake to me?

Dim MKT As String
Dim AGRP As String
Dim AENO As Integer

'**NEW HAS THREE POSSIBLE STATES - 0 WHEN FORM IS OPENED, 1 WHEN NEW
RECORD, 2 WHEN EXISTING RECORD
If Me.WDNEW = 2 Then
'UPDATE RECORD
MKT = "WD"
AGRP = "7"
AENO = Me![Text9]

'Call update_sql(MKT, AGRP, AENO)
Dim SSQL1
SSQL1 = "UPDATE tblFUTURE_AUDITS SET
tblFUTURE_AUDITS.intFULL_SCOPE_HRS = ME." & MKT & "_FULL_HRS," & _
"tblFUTURE_AUDITS.intLTD_SCOPE_HRS = me." & MKT & "_LTD_HRS , " & _
"tblFUTURE_AUDITS.intSOX_404_HRS = me." & MKT & "_SOX_HRS, " & _
"tblFUTURE_AUDITS.intFULL_SCOPE_IT = me." & MKT & "_FULL_IT, " & _
"tblFUTURE_AUDITS.intLTD_SCOPE_IT = me." & MKT & "_LTD_IT, " & _
"tblFUTURE_AUDITS.intSOX_404_IT = me." & MKT & "_sox_it, " & _
"tblFUTURE_AUDITS.intCONTINUOUS_AUD_HRS = me." & MKT & "_ca_hrs, " & _
"tblFUTURE_AUDITS.intOTHER = me." & MKT & "_other " & _
"WHERE [txtAUDIT_ENTITY_NO] = " & AENO & " AND TXTAUDGRP = " & "'" & AGRP &
"'"
MsgBox SSQL1

CurrentDb.Execute SSQL, dbfailonerror
 
Ok, let's say I was executing the right sequel statement, can you think of
any reason why this wouldn't update the fields in my table.
--
Ficticiously Yours, Biggles


Bagger said:
"CurrentDb.Execute SSQL, dbfailonerror "

Your querystring variable is called "SSQL1", but you're executing "SSQL"

Biggles said:
When I try to run the following, I get the MS Jet database cannot find the
input table or query ". Make sure it exists etc. error

Can anyone point out my mistake to me?

Dim MKT As String
Dim AGRP As String
Dim AENO As Integer

'**NEW HAS THREE POSSIBLE STATES - 0 WHEN FORM IS OPENED, 1 WHEN NEW
RECORD, 2 WHEN EXISTING RECORD
If Me.WDNEW = 2 Then
'UPDATE RECORD
MKT = "WD"
AGRP = "7"
AENO = Me![Text9]

'Call update_sql(MKT, AGRP, AENO)
Dim SSQL1
SSQL1 = "UPDATE tblFUTURE_AUDITS SET
tblFUTURE_AUDITS.intFULL_SCOPE_HRS = ME." & MKT & "_FULL_HRS," & _
"tblFUTURE_AUDITS.intLTD_SCOPE_HRS = me." & MKT & "_LTD_HRS , " & _
"tblFUTURE_AUDITS.intSOX_404_HRS = me." & MKT & "_SOX_HRS, " & _
"tblFUTURE_AUDITS.intFULL_SCOPE_IT = me." & MKT & "_FULL_IT, " & _
"tblFUTURE_AUDITS.intLTD_SCOPE_IT = me." & MKT & "_LTD_IT, " & _
"tblFUTURE_AUDITS.intSOX_404_IT = me." & MKT & "_sox_it, " & _
"tblFUTURE_AUDITS.intCONTINUOUS_AUD_HRS = me." & MKT & "_ca_hrs, " & _
"tblFUTURE_AUDITS.intOTHER = me." & MKT & "_other " & _
"WHERE [txtAUDIT_ENTITY_NO] = " & AENO & " AND TXTAUDGRP = " & "'" & AGRP &
"'"
MsgBox SSQL1

CurrentDb.Execute SSQL, dbfailonerror
 
I could probably think of several reasons, but they'd all depend on what the
querystring ends up looking like. If you could give me an error message to
go on, that might help too. :)

Biggles said:
Ok, let's say I was executing the right sequel statement, can you think of
any reason why this wouldn't update the fields in my table.
--
Ficticiously Yours, Biggles


Bagger said:
"CurrentDb.Execute SSQL, dbfailonerror "

Your querystring variable is called "SSQL1", but you're executing "SSQL"

Biggles said:
When I try to run the following, I get the MS Jet database cannot find the
input table or query ". Make sure it exists etc. error

Can anyone point out my mistake to me?

Dim MKT As String
Dim AGRP As String
Dim AENO As Integer

'**NEW HAS THREE POSSIBLE STATES - 0 WHEN FORM IS OPENED, 1 WHEN NEW
RECORD, 2 WHEN EXISTING RECORD
If Me.WDNEW = 2 Then
'UPDATE RECORD
MKT = "WD"
AGRP = "7"
AENO = Me![Text9]

'Call update_sql(MKT, AGRP, AENO)
Dim SSQL1
SSQL1 = "UPDATE tblFUTURE_AUDITS SET
tblFUTURE_AUDITS.intFULL_SCOPE_HRS = ME." & MKT & "_FULL_HRS," & _
"tblFUTURE_AUDITS.intLTD_SCOPE_HRS = me." & MKT & "_LTD_HRS , " & _
"tblFUTURE_AUDITS.intSOX_404_HRS = me." & MKT & "_SOX_HRS, " & _
"tblFUTURE_AUDITS.intFULL_SCOPE_IT = me." & MKT & "_FULL_IT, " & _
"tblFUTURE_AUDITS.intLTD_SCOPE_IT = me." & MKT & "_LTD_IT, " & _
"tblFUTURE_AUDITS.intSOX_404_IT = me." & MKT & "_sox_it, " & _
"tblFUTURE_AUDITS.intCONTINUOUS_AUD_HRS = me." & MKT & "_ca_hrs, " & _
"tblFUTURE_AUDITS.intOTHER = me." & MKT & "_other " & _
"WHERE [txtAUDIT_ENTITY_NO] = " & AENO & " AND TXTAUDGRP = " & "'" & AGRP &
"'"
MsgBox SSQL1

CurrentDb.Execute SSQL, dbfailonerror
 
That's the thing, there was no error message, I went to the table and noticed
it was not changed.
Thanks
--
Ficticiously Yours, Biggles


Bagger said:
I could probably think of several reasons, but they'd all depend on what the
querystring ends up looking like. If you could give me an error message to
go on, that might help too. :)

Biggles said:
Ok, let's say I was executing the right sequel statement, can you think of
any reason why this wouldn't update the fields in my table.
--
Ficticiously Yours, Biggles


Bagger said:
"CurrentDb.Execute SSQL, dbfailonerror "

Your querystring variable is called "SSQL1", but you're executing "SSQL"

:

When I try to run the following, I get the MS Jet database cannot find the
input table or query ". Make sure it exists etc. error

Can anyone point out my mistake to me?

Dim MKT As String
Dim AGRP As String
Dim AENO As Integer

'**NEW HAS THREE POSSIBLE STATES - 0 WHEN FORM IS OPENED, 1 WHEN NEW
RECORD, 2 WHEN EXISTING RECORD
If Me.WDNEW = 2 Then
'UPDATE RECORD
MKT = "WD"
AGRP = "7"
AENO = Me![Text9]

'Call update_sql(MKT, AGRP, AENO)
Dim SSQL1
SSQL1 = "UPDATE tblFUTURE_AUDITS SET
tblFUTURE_AUDITS.intFULL_SCOPE_HRS = ME." & MKT & "_FULL_HRS," & _
"tblFUTURE_AUDITS.intLTD_SCOPE_HRS = me." & MKT & "_LTD_HRS , " & _
"tblFUTURE_AUDITS.intSOX_404_HRS = me." & MKT & "_SOX_HRS, " & _
"tblFUTURE_AUDITS.intFULL_SCOPE_IT = me." & MKT & "_FULL_IT, " & _
"tblFUTURE_AUDITS.intLTD_SCOPE_IT = me." & MKT & "_LTD_IT, " & _
"tblFUTURE_AUDITS.intSOX_404_IT = me." & MKT & "_sox_it, " & _
"tblFUTURE_AUDITS.intCONTINUOUS_AUD_HRS = me." & MKT & "_ca_hrs, " & _
"tblFUTURE_AUDITS.intOTHER = me." & MKT & "_other " & _
"WHERE [txtAUDIT_ENTITY_NO] = " & AENO & " AND TXTAUDGRP = " & "'" & AGRP &
"'"
MsgBox SSQL1

CurrentDb.Execute SSQL, dbfailonerror
 
Scratch that, I am getting an error message,

Too few parameters, expected 8.

Is the execute sql going to understand the me.wd_full_hrs or do I need to
define the variables better.
--
Ficticiously Yours, Biggles


Biggles said:
That's the thing, there was no error message, I went to the table and noticed
it was not changed.
Thanks
--
Ficticiously Yours, Biggles


Bagger said:
I could probably think of several reasons, but they'd all depend on what the
querystring ends up looking like. If you could give me an error message to
go on, that might help too. :)

Biggles said:
Ok, let's say I was executing the right sequel statement, can you think of
any reason why this wouldn't update the fields in my table.
--
Ficticiously Yours, Biggles


:

"CurrentDb.Execute SSQL, dbfailonerror "

Your querystring variable is called "SSQL1", but you're executing "SSQL"

:

When I try to run the following, I get the MS Jet database cannot find the
input table or query ". Make sure it exists etc. error

Can anyone point out my mistake to me?

Dim MKT As String
Dim AGRP As String
Dim AENO As Integer

'**NEW HAS THREE POSSIBLE STATES - 0 WHEN FORM IS OPENED, 1 WHEN NEW
RECORD, 2 WHEN EXISTING RECORD
If Me.WDNEW = 2 Then
'UPDATE RECORD
MKT = "WD"
AGRP = "7"
AENO = Me![Text9]

'Call update_sql(MKT, AGRP, AENO)
Dim SSQL1
SSQL1 = "UPDATE tblFUTURE_AUDITS SET
tblFUTURE_AUDITS.intFULL_SCOPE_HRS = ME." & MKT & "_FULL_HRS," & _
"tblFUTURE_AUDITS.intLTD_SCOPE_HRS = me." & MKT & "_LTD_HRS , " & _
"tblFUTURE_AUDITS.intSOX_404_HRS = me." & MKT & "_SOX_HRS, " & _
"tblFUTURE_AUDITS.intFULL_SCOPE_IT = me." & MKT & "_FULL_IT, " & _
"tblFUTURE_AUDITS.intLTD_SCOPE_IT = me." & MKT & "_LTD_IT, " & _
"tblFUTURE_AUDITS.intSOX_404_IT = me." & MKT & "_sox_it, " & _
"tblFUTURE_AUDITS.intCONTINUOUS_AUD_HRS = me." & MKT & "_ca_hrs, " & _
"tblFUTURE_AUDITS.intOTHER = me." & MKT & "_other " & _
"WHERE [txtAUDIT_ENTITY_NO] = " & AENO & " AND TXTAUDGRP = " & "'" & AGRP &
"'"
MsgBox SSQL1

CurrentDb.Execute SSQL, dbfailonerror
 
Biggles said:
Scratch that, I am getting an error message,

Too few parameters, expected 8.

Is the execute sql going to understand the me.wd_full_hrs or do I need to
define the variables better.


No. Me only refers to the class module containing the VBA
procedure. Since you have the Me. inside the quotes, you
are using Me as a table name that is not mentioned in the
UPDATE clause.

I think all you need is to get rid of the Me.
 
Back
Top