Results 1 to 4 of 4
  1. #1
    bhatia.puja is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    2

    validating fields


    I have a table which has a country field and basis the values in that field i want the other field should get its value. For e.g. if country is 'uk' then the charges should be '200' or if the ountry is 'india' the chrges are '400'.if anybody could help solving this please.

  2. #2
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    you can do this as follows:

    On the country field after update event:

    Private sub Country_AfterUpdate()
    If me.Country="India"
    me.YourFieldHere.Value=400
    end if
    If me.Country="uk"
    me.YourFieldHere.Value=200
    end if

    End Sub

  3. #3
    bhatia.puja is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    2
    thanks! but i am looking for something which can be written in the 'validation' of a field in ms accesss

  4. #4
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Validation of data rules is checking and are used for data validity in a tables, not to decide the condition what is entered and gives the desired results. It will enable you to not save the data if it breaks any validation rules or routines.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Validating mutiple entry in a subform
    By Grooz13 in forum Forms
    Replies: 1
    Last Post: 08-09-2010, 06:53 AM
  2. Validating data entry in a form
    By bdhFS in forum Programming
    Replies: 1
    Last Post: 05-18-2010, 03:09 PM
  3. Replies: 5
    Last Post: 03-20-2010, 08:30 AM
  4. Validating Field Data Across Tables?
    By venomshot in forum Forms
    Replies: 4
    Last Post: 02-04-2010, 05:04 PM
  5. Validating tables
    By JVagenheart in forum Database Design
    Replies: 1
    Last Post: 06-10-2006, 09:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums