Insert Into do not find my table on split bd

ricardofbarreiro

Registered User.
Local time
Today, 17:35
Joined
Jun 19, 2014
Messages
17
Private Sub Form_AfterInsert()
Dim strSql$
MsgBox "Nova Peça Criada"

srtSQL = "INSERT INTO tblVerificacao (Verificação,ID_Peça) VALUES (""1"",'" & Me!TxtID_Peça & "')"
CurrentDb.Execute strSql

End Sub

Table not found, but this linked table from my backend is correct.

What is wrong?
 

Attachments

Hello,

I'm not sure that there is problem but maybe national characters in field names are causing problem... so try reneme the field to ommit characters "ç" and "ã"

the second option why this is not working may be that you are trying to insert value into unique key field which already is inserted in another row in the table....


I'm not 100% sure that above suggestion will solve problem - but just you can try/verify
 
Private Sub Form_AfterInsert()
Dim strSql$
MsgBox "Nova Peça Criada"

srtSQL = "INSERT INTO tblVerificacao (Verificação,ID_Peça) VALUES (""1"",'" & Me!TxtID_Peça & "')"
CurrentDb.Execute strSql

End Sub

Table not found, but this linked table from my backend is correct.

What is wrong?
There is a "typo" in your code.
You declare a variable strSql$ but add a string value to a variable called srtSQL.
If you always include the Option Explicit statement in your module, you would have got a warning about the undeclared variable srtSQL, and I'm sure it would have saved you a lot of time.
 

Users who are viewing this thread

Back
Top Bottom