Results 1 to 8 of 8
  1. #1
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42

    form question

    Okay I am getting close to finishing these forms.

    Have my subform pulling from a query. There are cases where the query will return a null value; however on the form if the query returned a null value I am getting an error message. How can I correct this one

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Change the control source of the control that is bound to that field to something like this (replacing with your actual field name):

    =IIf(IsNull([FieldNameHere]), "", [FieldNameHere])

    Also make sure that the control that this field is bound to doesn't have the same name as the field (which is the default when Access creates a control for you). So if your field was named Price you would use txtPrice for the control name and use the Field name of Price in the control source.

    Also, if the above control source gives an error you might need to use

    =IIf(IsNull([FieldNameHere]), 0, [FieldNameHere])

    if your field is numeric.

  3. #3
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42
    This is one is confusing me. I have to fields that are almost Identical - they each look at the query then pull the picture file from the table
    The first

    =IIf(IsNull([Cap Picture]),0,[Cap Picture])

    is working
    BUT

    =IIf(IsNull([Logo Picture]),0,[Logo Picture])

    is not

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Is there a control named Logo Picture (just like the field name) on the form? If so, you would need to rename the control from [Logo Picture] to maybe txtLogoPicture.

  5. #5
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42
    Nope that did not work. I am getting the error

    "The Microsoft Access database engine cannot find a record in the table 'Logo Picture' with key matching field(s)"

    I am not getting the error if this field is not null

  6. #6
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Is Logo Picture in the form's Record Source? Also, what datatype is the first one and this one? Are they both the same datatypes?

  7. #7
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42
    Yes Logo picture is in the form's data source. Both datatype's are attachments

  8. #8
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Well, I don't use attachments so I may not be able to help any further with this one. For displaying pics I would store them in an accessible file server location and then use the Picture Box to display them based on storing the PATH and file name.

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

Similar Threads

  1. Combo box form question
    By abarin in forum Forms
    Replies: 3
    Last Post: 06-01-2011, 12:10 PM
  2. Form Design Question
    By mmori in forum Forms
    Replies: 0
    Last Post: 02-21-2011, 04:52 PM
  3. Pop-Up Form Question
    By DKF in forum Forms
    Replies: 1
    Last Post: 07-02-2010, 05:57 PM
  4. Sub-Form Question
    By amcglone in forum Forms
    Replies: 2
    Last Post: 06-07-2010, 10:33 AM
  5. Question about Form
    By ACM in forum Programming
    Replies: 3
    Last Post: 10-09-2009, 04:25 PM

Posting Permissions

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