2014-02-16 59 views
0

我有一个跟踪客户端,客户端区域和事务类型的MS Access数据库。 用户键入事务处理,一旦完成,系统需要创建按客户区域总部排序的字母 客户区域(区域A,B等)AND事务类型(TransType 1,TransType 2)eg.Region A:TransType 1 ,Region B:TransType 1,Region A:TransType 2.分组数据跟踪

我正在使用VBA,SQL语句(通过VBA运行),Word OLE自动化,ADODB记录集和唯一字符串。 任何人都可以建议我如何构建我的数据库来跟踪字母和所有关于这些字母的细节?

回答

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.