I have a command button that imports a text file. Since this file doesn't have a month field, I also run an update query which puts the month (based on what the user enters when prompted, which comes from the qUpdateMonth query) in that field. Breifly, I do this with the following code:
DoCmd.TransferText acImportFixed, "ImportCPC", "tCPC", txtFilePath
DoCmd.OpenQuery qUpdateMonth, acViewNormal
MsgBox "You updated the table for the month " + [qUpdateMonth].[StmtMonthYear], vbYesNo, "Report Table Update"
DoCmd.Close
StmtMonthYear is the field whose value from the prompt in the qUpdateMonth query I would like to see in the MsgBox. I've tried all kinds of ways (including an ampersand) besides the plus sign and bracketts and dots, but I keep getting the message "CPC can't find the field '|' referred to in your expresion." CPC is the name of the database.
Is there a way to get that value (the user enters when prompted) as part of the text (or maybe the title bar if it can't be in the text) in the MsgBox, and if so, do you know the syntax?
DoCmd.TransferText acImportFixed, "ImportCPC", "tCPC", txtFilePath
DoCmd.OpenQuery qUpdateMonth, acViewNormal
MsgBox "You updated the table for the month " + [qUpdateMonth].[StmtMonthYear], vbYesNo, "Report Table Update"
DoCmd.Close
StmtMonthYear is the field whose value from the prompt in the qUpdateMonth query I would like to see in the MsgBox. I've tried all kinds of ways (including an ampersand) besides the plus sign and bracketts and dots, but I keep getting the message "CPC can't find the field '|' referred to in your expresion." CPC is the name of the database.
Is there a way to get that value (the user enters when prompted) as part of the text (or maybe the title bar if it can't be in the text) in the MsgBox, and if so, do you know the syntax?