Is It Possible To Write Sql In Data Validation Rule?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fanyang
    New Member
    • Feb 2007
    • 2

    Is It Possible To Write Sql In Data Validation Rule?

    Hi,

    I am new to SQL.

    I am building a form to do data entry. I have some questions in the questionnaire like:
    a). are you qualified?
    b). if you are qualified, which level?

    I want to restrict the data entry for question b only when answer in question a is "Yes".

    I am not sure if I need to wrtie any SQL program or I can do that by clicking on "..." button in validation rule?

    If it is possible to do, could anyone tell me how to do it?

    Many thanks.
    Fan
  • vijaydiwakar
    Contributor
    • Feb 2007
    • 579

    #2
    Originally posted by Fanyang
    Hi,

    I am new to SQL.

    I am building a form to do data entry. I have some questions in the questionnaire like:
    a). are you qualified?
    b). if you are qualified, which level?

    I want to restrict the data entry for question b only when answer in question a is "Yes".

    I am not sure if I need to wrtie any SQL program or I can do that by clicking on "..." button in validation rule?

    If it is possible to do, could anyone tell me how to do it?

    Many thanks.
    Fan
    u can apply validation before executing qry from frontend or u may use check option if ur using oracle

    Comment

    • Fanyang
      New Member
      • Feb 2007
      • 2

      #3
      Originally posted by vijaydiwakar
      u can apply validation before executing qry from frontend or u may use check option if ur using oracle
      Thank you so much, vijaydiwakar.

      Sorry I don't quite understand your email. I am using ACCESS. Would you be able to tell me exactly what I need to do?

      Comment

      • vijaydiwakar
        Contributor
        • Feb 2007
        • 579

        #4
        Originally posted by Fanyang
        Thank you so much, vijaydiwakar.

        Sorry I don't quite understand your email. I am using ACCESS. Would you be able to tell me exactly what I need to do?
        u may first check if question is checked if yes then
        create sql to execute
        as
        if question is checked then
        dim ssql$
        ssql="insert into <table>(<filedn ame>) values(<Field values>)"
        conn.execute ssql
        end if

        it is not the pure code i'm giving u d blue print how to do so

        Comment

        Working...