PDA

View Full Version : Need help to setup restriction (countries) on an already existed VBA



siulonbow
09-29-2010, 09:30 AM
Hi,

I recently got a project to enhance a new field to restrict some countries from an invoice. For setting up restriction for certain matters, is it better to set a table and list out all of the countries that I want to include, and the one that is left out, then I want to restrict them?

I don't have the data with me because the data will extract out from another database that I don't have access to. My role now is only to put a restriction tool in the form so when the data entry people run the form, it can restrict them from entering data from the countries that is restricted by the company.
PS: since I can't post an attachment on this thread, the restriction data I am planning to have is listed like below, please teach me how I can have the code look up to the worksheet placed on the desktop (later on I will put this file on the share folder with the vba and form). what I want to do is to put a restriction warning if the data entry person enter an restriction country, then it will not help them process the invoice into the database. Please advice.

Countries
India
Nigeria

Bob Phillips
09-29-2010, 10:08 AM
A list of countries doesn't really help much. But yes, a list of included countries is better than excluded.

When you can post the actual workbook with the invoice etc., that will be more helpful.

siulonbow
09-29-2010, 10:49 AM
I have attached the screen shot, and I would like to add a dropbox to list out the country included. Are there anyway I can have a list of un-restricted countries? Please demonstrate. Thanks

Later on, I would want to add a date field that will automatically send out a reminder email to the customer saying it's time to make a payment.

Bob Phillips
09-29-2010, 11:57 AM
Very pretty!

Seriously, pictures and words make for an interesting view, but I doubt many of us want to setup your workbook from scratch.

The workbook, with your current code, would be far more helpful.

siulonbow
09-29-2010, 12:23 PM
I have attached the code with the userform under .sln file. Please let me know. Thanks

Bob Phillips
09-29-2010, 12:58 PM
I can't load that in VS2010.

siulonbow
09-29-2010, 02:06 PM
I am using MS VB express, would this cause problem opening it? How should I upload the file so that you can view it?

Bob Phillips
09-29-2010, 02:39 PM
Not sure, I haven't used VB Express for a few years, shouldn't here be a proj file and some cls and/or frm files as well?

Bob Phillips
09-30-2010, 01:12 AM
Now cross-posted as VBTalk http://www.xtremevbtalk.com/showthread.php?t=318318