Vba 分组数据跟踪
我有一个MS Access数据库,可以跟踪客户端、客户端区域和事务类型。 用户正在键入交易,一旦完成,系统需要创建发送给客户地区总部的信件,按 客户区域(区域A、B等)和交易类型(交易类型1、交易类型2),如区域A:交易类型1、区域B:交易类型1、区域A:交易类型2 我正在使用VBA、SQL语句(通过VBA运行)、Word OLE Automation、ADODB记录集和唯一字符串。Vba 分组数据跟踪,vba,ms-access,database-design,Vba,Ms Access,Database Design,我有一个MS Access数据库,可以跟踪客户端、客户端区域和事务类型。 用户正在键入交易,一旦完成,系统需要创建发送给客户地区总部的信件,按 客户区域(区域A、B等)和交易类型(交易类型1、交易类型2),如区域A:交易类型1、区域B:交易类型1、区域A:交易类型2 我正在使用VBA、SQL语句(通过VBA运行)、Word OLE Automation、ADODB记录集和唯一字符串。 有谁能建议我如何构建数据库以跟踪信件以及有关信件的所有详细信息吗?我发现解决此问题的工作流程是: +Create
有谁能建议我如何构建数据库以跟踪信件以及有关信件的所有详细信息吗?我发现解决此问题的工作流程是:
+Create a list of the transactions sorted by client regions and by transaction types
+Load into a recordset and go to first record
+Get the current values for client region and transaction type
+Create a unique string
+Create a letter and capture all necessary details in a letter table including the unique string
+Run a select statement for LetterID for where unique string field is current unique string value
+Update the transactions with New Letter ID and mark as batched
+Loop through the whole recordset
+Move to next record
+Check if client regions and transaction types is the same.
+If same, Update the transactions with current Letter ID and mark as batched
+If different, create using above method.