I have a snippet of code I wrote:
that produces a query string:
My "tblMappedAssets" table also has fields for DateStamp and UserID. I can get these from NOW() and capturing the logged on user; but I do not know the syntax to add them to my query.
Thanks!
Alan
Code:
sqlString = "INSERT INTO tblMappedAssets " _
& "( AssetID, [File Name], [Software Name], Version, Family, Category, Publisher, Description)" _
& "SELECT tempImport." & Me.cboAsset.Value & " AS [Asset ID], " _
& "tempImport." & Me.cboFileNAme.Value & " AS [File Name], " _
& "tempImport." & Me.cboSoftware.Value & " AS [Software Name], " _
& "tempImport." & Me.cboVersion.Value & " AS Version, " _
& "tempImport." & Me.cboFamily.Value & " AS Family, " _
& "tempImport." & Me.cboCategory.Value & " AS Category, " _
& "tempImport." & Me.cboPublisher.Value & " AS Publisher, " _
& "tempImport." & Me.cboDesc.Value & " AS Description " _
& " FROM tempImport;" [red]'DateTime to be defined[/red]
Debug.Print sqlString
DoCmd.RunSQL sqlString
Code:
INSERT INTO tblMappedAssets ( AssetID, [File Name], [Software Name], Version, Family, Category, Publisher, Description)SELECT tempImport.ASSET_ID AS [Asset ID], tempImport.PULSE AS [File Name], tempImport.PRODUCT_ID AS [Software Name], tempImport.VERSION AS Version, tempImport.FAMILY AS Family, tempImport.CATEGORY AS Category, tempImport.PUBLISHER AS Publisher, tempImport.AMGUID AS Description
FROM tempImport;
Thanks!
Alan