silentwolf
Well-known Member
- Joined
- May 14, 2008
- Messages
- 1,216
- Office Version
- 2016
Hi guys,
something simple for you I am pretty sure )
Can someone please let me know how does this code need to be changed the strSQL with the strTable varible?
Thanks for your help )
something simple for you I am pretty sure )
VBA Code:
Dim db As DAO.Database
Dim tbd As DAO.TableDef
Dim strSQL As String
Dim strTable As String
strTable = "Neu"
Set db = CurrentDb
Set tbd = db.TableDefs(strTable)
'this is ok when I use the Query Builder...
strSQL = "UPDATE Neu SET Neu.Zahlungsreferenz = [Neu].[ZahlRef] " & _
"WHERE (((Neu.Zahlungsreferenz)=""x"") AND ((Neu.ZahlRef)<>""""));"
'How this need to be changed to be able to use the strTable Varible?
strSQL = "UPDATE " & strTable & " SET [Zahlungsreferenz] = [ZahlRef] " & _
"WHERE (([Zahlungsreferenz])=""x"") AND [ZahlRef]<>""));"
db.Execute strSQL
Set db = Nothing
Can someone please let me know how does this code need to be changed the strSQL with the strTable varible?
Thanks for your help )