Insert into table pronlem

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

I am using the code below to try and insert a new line into the table
"tblQualifications" with Values "id" and "CMAP"
"id" is a Text box value on a my form and "CMAP" is simply a text value in
the code.

"id" to be inserted into the field [id] in the table and "CMAP" into the
field [strQualifications].

I keep getting a syntax error. Could someone please give me the correct
sytax for this.

Thanks

Les

Dim strsql As String

If [cmap] = "True" Then
strsql = "Insert Into tblQualifications (ID)& (strQualifications)""" _
& "Values(" & Me!id & "CMAP"")"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else


End If
 
Try replacing your strsql string with:


strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & "'CMAP')"

Rgds,
Glenn.
 
Thanks Glen

This gives a syntax error with strQualifications Highlighted


Glenn said:
Try replacing your strsql string with:


strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & "'CMAP')"

Rgds,
Glenn.
-----Original Message-----
I am using the code below to try and insert a new line into the table
"tblQualifications" with Values "id" and "CMAP"
"id" is a Text box value on a my form and "CMAP" is simply a text value in
the code.

"id" to be inserted into the field [id] in the table and "CMAP" into the
field [strQualifications].

I keep getting a syntax error. Could someone please give me the correct
sytax for this.

Thanks

Les

Dim strsql As String

If [cmap] = "True" Then
strsql = "Insert Into tblQualifications (ID)& (strQualifications)""" _
& "Values(" & Me!id & "CMAP"")"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else


End If


.
 
Les,

Sorry, I missed a comma......

strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & ", 'CMAP')"

Also ensure it's all in one line not word wrapped as above.

Glenn.
-----Original Message-----
Thanks Glen

This gives a syntax error with strQualifications Highlighted


Try replacing your strsql string with:


strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & "'CMAP')"

Rgds,
Glenn.
-----Original Message-----
I am using the code below to try and insert a new line into the table
"tblQualifications" with Values "id" and "CMAP"
"id" is a Text box value on a my form and "CMAP" is simply a text value in
the code.

"id" to be inserted into the field [id] in the table and "CMAP" into the
field [strQualifications].

I keep getting a syntax error. Could someone please
give
me the correct
sytax for this.

Thanks

Les

Dim strsql As String

If [cmap] = "True" Then
strsql = "Insert Into tblQualifications (ID)& (strQualifications)""" _
& "Values(" & Me!id & "CMAP"")"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else


End If


.


.
 
Glen thanks for the reply

I have done this but I am still getting an Expected End Of Statement on
strQualifications.

I can confirm its all on one line.

Les

Glenn said:
Les,

Sorry, I missed a comma......

strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & ", 'CMAP')"

Also ensure it's all in one line not word wrapped as above.

Glenn.
-----Original Message-----
Thanks Glen

This gives a syntax error with strQualifications Highlighted


Try replacing your strsql string with:


strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & "'CMAP')"

Rgds,
Glenn.

-----Original Message-----
I am using the code below to try and insert a new line
into the table
"tblQualifications" with Values "id" and "CMAP"
"id" is a Text box value on a my form and "CMAP" is
simply a text value in
the code.

"id" to be inserted into the field [id] in the table
and "CMAP" into the
field [strQualifications].

I keep getting a syntax error. Could someone please give
me the correct
sytax for this.

Thanks

Les

Dim strsql As String

If [cmap] = "True" Then
strsql = "Insert Into tblQualifications (ID)&
(strQualifications)""" _
& "Values(" & Me!id & "CMAP"")"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else


End If


.


.
 
Les,

Would you please repost the code as you have it now,
because I have tested a similar scenario and it works fine.

Thanks,
Glenn.
-----Original Message-----
Glen thanks for the reply

I have done this but I am still getting an Expected End Of Statement on
strQualifications.

I can confirm its all on one line.

Les

Les,

Sorry, I missed a comma......

strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & ", 'CMAP')"

Also ensure it's all in one line not word wrapped as above.

Glenn.
-----Original Message-----
Thanks Glen

This gives a syntax error with strQualifications Highlighted



Try replacing your strsql string with:


strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & "'CMAP')"

Rgds,
Glenn.

-----Original Message-----
I am using the code below to try and insert a new line
into the table
"tblQualifications" with Values "id" and "CMAP"
"id" is a Text box value on a my form and "CMAP" is
simply a text value in
the code.

"id" to be inserted into the field [id] in the table
and "CMAP" into the
field [strQualifications].

I keep getting a syntax error. Could someone please give
me the correct
sytax for this.

Thanks

Les

Dim strsql As String

If [cmap] = "True" Then
strsql = "Insert Into tblQualifications (ID)&
(strQualifications)""" _
& "Values(" & Me!id & "CMAP"")"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else


End If


.



.


.
 
Glen here is the full code

Thanks

Dim strsql As String

If [chkcmap] = "True" Then

strsql = "Insert Into tblQualifications (ID,"strQualifications)Values (" &
Me!id & ", 'CMAP')"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else

End If




Glenn said:
Les,

Would you please repost the code as you have it now,
because I have tested a similar scenario and it works fine.

Thanks,
Glenn.
-----Original Message-----
Glen thanks for the reply

I have done this but I am still getting an Expected End Of Statement on
strQualifications.

I can confirm its all on one line.

Les

Les,

Sorry, I missed a comma......

strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & ", 'CMAP')"

Also ensure it's all in one line not word wrapped as above.

Glenn.

-----Original Message-----
Thanks Glen

This gives a syntax error with strQualifications
Highlighted


message

Try replacing your strsql string with:


strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & "'CMAP')"

Rgds,
Glenn.

-----Original Message-----
I am using the code below to try and insert a new line
into the table
"tblQualifications" with Values "id" and "CMAP"
"id" is a Text box value on a my form and "CMAP" is
simply a text value in
the code.

"id" to be inserted into the field [id] in the table
and "CMAP" into the
field [strQualifications].

I keep getting a syntax error. Could someone please
give
me the correct
sytax for this.

Thanks

Les

Dim strsql As String

If [cmap] = "True" Then
strsql = "Insert Into tblQualifications (ID)&
(strQualifications)""" _
& "Values(" & Me!id & "CMAP"")"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else


End If


.



.


.
 
Les,

Remove the double-quotes (") from before
strQualifications. This should do the trick.

Regards,
Glenn.

-----Original Message-----
Glen here is the full code

Thanks

Dim strsql As String

If [chkcmap] = "True" Then

strsql = "Insert Into tblQualifications
(ID,"strQualifications)Values (" &
Me!id & ", 'CMAP')"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else

End If




Les,

Would you please repost the code as you have it now,
because I have tested a similar scenario and it works fine.

Thanks,
Glenn.
-----Original Message-----
Glen thanks for the reply

I have done this but I am still getting an Expected End Of Statement on
strQualifications.

I can confirm its all on one line.

Les

Les,

Sorry, I missed a comma......

strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & ", 'CMAP')"

Also ensure it's all in one line not word wrapped as above.

Glenn.

-----Original Message-----
Thanks Glen

This gives a syntax error with strQualifications
Highlighted


message

Try replacing your strsql string with:


strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & "'CMAP')"

Rgds,
Glenn.

-----Original Message-----
I am using the code below to try and insert a new line
into the table
"tblQualifications" with Values "id" and "CMAP"
"id" is a Text box value on a my form and "CMAP" is
simply a text value in
the code.

"id" to be inserted into the field [id] in the table
and "CMAP" into the
field [strQualifications].

I keep getting a syntax error. Could someone please
give
me the correct
sytax for this.

Thanks

Les

Dim strsql As String

If [cmap] = "True" Then
strsql = "Insert Into tblQualifications (ID)&
(strQualifications)""" _
& "Values(" & Me!id & "CMAP"")"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else


End If


.



.



.


.
 
Thanks Glen thats done it!

Now how did I manage to miss that I ask myself.

Les


Glenn said:
Les,

Remove the double-quotes (") from before
strQualifications. This should do the trick.

Regards,
Glenn.

-----Original Message-----
Glen here is the full code

Thanks

Dim strsql As String

If [chkcmap] = "True" Then

strsql = "Insert Into tblQualifications
(ID,"strQualifications)Values (" &
Me!id & ", 'CMAP')"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else

End If




Les,

Would you please repost the code as you have it now,
because I have tested a similar scenario and it works fine.

Thanks,
Glenn.

-----Original Message-----
Glen thanks for the reply

I have done this but I am still getting an Expected End
Of Statement on
strQualifications.

I can confirm its all on one line.

Les

message
Les,

Sorry, I missed a comma......

strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & ", 'CMAP')"

Also ensure it's all in one line not word wrapped as
above.

Glenn.

-----Original Message-----
Thanks Glen

This gives a syntax error with strQualifications
Highlighted


message

Try replacing your strsql string with:


strsql = "Insert Into tblQualifications (ID,
strQualifications) Values (" & Me!id & "'CMAP')"

Rgds,
Glenn.

-----Original Message-----
I am using the code below to try and insert a new
line
into the table
"tblQualifications" with Values "id" and "CMAP"
"id" is a Text box value on a my form and "CMAP" is
simply a text value in
the code.

"id" to be inserted into the field [id] in the table
and "CMAP" into the
field [strQualifications].

I keep getting a syntax error. Could someone please
give
me the correct
sytax for this.

Thanks

Les

Dim strsql As String

If [cmap] = "True" Then
strsql = "Insert Into tblQualifications (ID)&
(strQualifications)""" _
& "Values(" & Me!id & "CMAP"")"

CurrentDb.Execute strsql, dbFailOnError

Form![frmAssociate_Details].Requery

Else


End If


.



.



.


.
 
Back
Top