我有一个跟踪客户端,客户端区域和事务类型的MS Access数据库。 用户正在键入事务,一旦完成,系统需要创建到客户区域总部的字母排序 客户区域(区域A,B等)和事务类型(TransType 1,TransType 2)eg.Region A:TransType 1,Region B:TransType 1,Region A:TransType 2.
我正在使用VBA,SQL语句(通过VBA运行),Word OLE自动化,ADODB记录集和唯一字符串。 有人可以建议如何构建我的数据库来跟踪字母和所有关于字母的细节吗?
答案 0 :(得分:0)
我发现这个问题的工作流程是:
+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.