Validation Macro

From: Keith Austin <kcaus_at_bigpond.net.au>
Date: Mon, 15 Aug 2005 23:17:29 GMT
Message-ID: <do9Me.86254$oJ.35907_at_news-server.bigpond.net.au>



I need to produce a macro for a project that I have to do in my course in IT "Certificate III IT (Software Applications) Unit ICAITUO18C". The macro needs to validate previously imported data from Text Files. I have already written the macro to import the data and now this Validate Macro forms part of that Macro. The case scenario relates to a Music Expo and 3 bands appear in this exercise. Obviously the previous macro wont complete until this macro hace been written.

Macro Name: mcrValidate
Description: Validate imported data
Solution:

1. If band name is empty insert name "Douglas Groovers"
2. If band name is "FS" replace with "Funk Sands"
3. If type is "Pensioner" or "A" replace with "Adult"
4. If type is "S" replace with "Student"
5. If status is "Current" or "A" replace with "Active"
6. If status is "NotCurrent" or "N" replace with "Inactive"
7. If type not "Under 14" go to next record otherwise delete record from 
table.

The purpose of this is because the 3 different bands use different names / methods to identify their data, this macro is to make them all uniform.

Scope: To be run once only
Limitations: Specific to text files provided - do not use with other text files.

Hint: Tools>Options>Edit/Find tab and remove tick for confirm - Record changes so Access does not prompt for confirmation on every record to be deleted.

I have made an atempt on the first "Condition" but i cannot see any action relating to inserting/changing the data in the empty field (replace empty with "Douglas groovers" I was given a hint to use "Condition- [Band Name]=Null then Action - SetValue" at the bottom there are 2 areas to fill in Item and Expression. The previous macro opens a form "frmValidate" and there are text boxes on this form one of which is "Band Name" so on the Item area I use [Forms]![frmValidate]![Band Name] then from there no matter what i place in there including just "Douglas Groovers" I get error messages I have done all this as instructed by my tutor either I have mis understood her or I have been given the wrong information. Any assistance will be greatly appreciated. I am really an absolute beginner where Access is concerned. I can only be guided by the info I have. The learning material / courseware does give ideas for "some macros" but not of this nature.

Regards Keith Received on Tue Aug 16 2005 - 01:17:29 CEST

Original text of this message