开发者

MS Access: Detecting a new item and notifiying user

开发者 https://www.devze.com 2023-04-08 14:30 出处:网络
I have an Access DB that stores sales data fo开发者_开发技巧r a small business.Each sale is recorded as a record in the \"Sales\" table.For each sale, the item name and customer name are stored, along

I have an Access DB that stores sales data fo开发者_开发技巧r a small business. Each sale is recorded as a record in the "Sales" table. For each sale, the item name and customer name are stored, along with some other information.

There is also a "Customer" table and an "Item" table, which contain all valid customers and items, respectively. If the user attempts to import a record that contains a customer that is not listed in the "Customer" table, this record is not imported; similar situation with items.

I would like to change this so that if the user attempts to import a record that contains a new customer or item, then the user is notified of this (e.g. "A new customer, Adam Smith, appears in one of the records you are trying to import.") and then given the option to add this new customer.

I realize that this is probably not good practice, but does anyone know of a quick way to add this functionality?

[Information regarding the import feature: The user's sales data is stored in an Excel workbook. To import new sales data, the user uses a form that I built that allows him to select a file to import and then imports the data into the proper table. This is implemented in VBA.]

Thanks!


You could link the Excel table, run a query that shows up new customers in a form. You can then ask the user to either match to an existing customer or create a new customer. The added records could be flagged as incomplete, if necessary, and the user could be asked to add relevant details at a suitable point.

Most of this can be accomplished with queries, for example, adding customers to the customer table can either be done with an append query or by writing the relevant data to the customer table by using fields in the review form.

0

精彩评论

暂无评论...
验证码 换一张
取 消