Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Table - Missing Operator Error

Status
Not open for further replies.

chris9

Programmer
Feb 11, 2003
32
US
OK, here's the code that I am trying to use:

Dim strSQL as String
Dim tnm as String

'Get the table name that I am creating in a form
tnm = Text0.Value

'I am adding another column to my trm table that is generated from my Makes table.

strSQL = "UPDATE " & tnm & " INNER JOIN MAKES ON " & _
tnm & ".MakeAbbr = MAKES.MakeAbbr SET " & _
tnm & ".MakeAbbr = '" & MAKES.MakeName"

DoCmd.RunSQL strSQL

When I try this code, I'm getting a syntax error(missing operator) in query '2002.MakeAbbr = MAKES.MakeAbbr'.
2002 was the table that I created or that was in tnm.
Any suggestion to get this debugged.

 
When I use this code I do not get an error, but it doesn't appear that the MakeName is the tnm table. I really need to get the MakeName somewhere into the tnm table either in it's own column or replace the MakeAbbr if the tnm.MakeAbbr = Makes.MakeAbbr.

Hopefully I've this is clear to understand and I greatly appreciate anyhelp.

Dim strSQL As String
Dim tnm As String


'Get the table name
tnm = [Forms]![Form1]!Text0.Value

strSQL = "UPDATE " & tnm & " AS A INNER JOIN Makes AS B ON A.MakeAbbr=B.MakeAbbr SET A.MakeAbbr = B.MakeName"

DoCmd.RunSQL strSQL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top