Results 1 to 3 of 3
  1. #1
    ceci123 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    2

    Exclamation Displaying image in calculated field

    hi.

    My first time here.

    I am trying to display an image1 and image2 which is stored as an 'OLE Object' data type. I also have other two fields: value1 and value2 both are 'Number' data type.

    I am trying to do this on my calculated field:

    Result: IIf([value1]<=[value2],[image1],[image2])



    When I run this it shows me some weird characters something like [?]$[?]

    Do you guys know how I can achieve this?

    Thank you.

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    assuming that u have to display only two pictures depending on the values of two fields Value1 and Value2 I have done the following:

    1) I have Created a table that will hold the pictures in a OLE Field.
    Tablename:tblpic
    Fields: PICID(Autonumber PK), PIC(OLE)
    2) I have a another table with the Following Fields
    Tablename: valueTable
    Fields: ID(Autonumber PK), Value1(Number), Value2 (Number)

    I build a form with table valueTable and put a Bound Object Frame with the Following expression in its Control Source

    =IIf([value1]<=[value2],DLookUp("[PIC]","tblpic","[PICID]=1"),DLookUp("[PIC]","tblpic","[PICID]=2"))


    Now this expression ensures that Picture with ID 1 is displayed when [Value1]<=[Value2] otherwise Picture 2 will be displayed.

    I have put this code in the on current even of the form:
    Me.OLEBound3.Requery

    This re queries the Object Frame when u navigate through the form displaying the correct picture.

  3. #3
    ceci123 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    2

    ACCWeb107000 - Field data type is incompatible with the Web.

    Thank you for your answer. I've tried your trick and it works... but its not web compatible.

    When I tried to deploy it I get a "ACCWeb107000... OLE Object type is incompatible with web" something along those lines. The other data types are
    http://office.microsoft.com/en-us/ac...#_Toc254722314 but not sure if I can use this to store an image.

    Thank you for your help.

    C

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

Similar Threads

  1. Replies: 1
    Last Post: 11-12-2010, 06:33 PM
  2. calculated field from calculated field?
    By RedGoneWILD in forum Reports
    Replies: 5
    Last Post: 08-03-2010, 02:32 PM
  3. Calculated field
    By nashr1928 in forum Forms
    Replies: 3
    Last Post: 07-22-2010, 05:10 AM
  4. Filename displaying with image
    By Rob Parker in forum Forms
    Replies: 2
    Last Post: 01-13-2010, 05:05 PM
  5. Error displaying image on form
    By mamba716 in forum Forms
    Replies: 6
    Last Post: 06-17-2009, 09:13 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
  •  
Other Forums: Microsoft Office Forums