Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Posts
    74

    Unanswered: check subform fields

    hi, how do i check if the fields in the subform is empty???

    pls advice
    nono

  2. #2
    Join Date
    Dec 2002
    Posts
    117

    Checking fields

    Take a look at the table where the subform's data is stored and open it and check if there is data stored in it.

  3. #3
    Join Date
    Nov 2003
    Posts
    74
    no.....

    i want to make sure that the user enter all the fields in the main and subform. so how can i check if the fields in the subform have no value???

    pls advice
    nono

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by damnnono_86
    no.....

    i want to make sure that the user enter all the fields in the main and subform. so how can i check if the fields in the subform have no value???

    pls advice
    nono
    You can use the LostFocus event of each field to check whether it is Null or not using the IsNull() function

  5. #5
    Join Date
    Nov 2003
    Posts
    74
    i have done it for the fields in the main form

    if me.txtName = "" or isnull(me.txtName) then
    msgbox "error"
    end if

    however i cannot do it for my subform!!!!!

    how can i do the same checking for my subform???

    pls advice
    nono

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    two choices:

    put your code in the subform - then it's EXACTLY the same process

    or, if your code is in the main form.
    if me!subFormControlName.txtName = "" or isnull(me!subFormControlName.txtName) then

    where subFormControlName is the name you find when you open the main form in design view, click once in the subform area, and check properties¦other¦name. NOTE that this subFormControlName is not always the name under which the form that is your subform has been saved.

    izy
    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •