Results 1 to 8 of 8
  1. #1
    dotcanada is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2015
    Location
    Alberta, Canada
    Posts
    44

    Image copies

    Good day.



    I have a table (tblTeams) with a list of teams in column 1. The second column is an image attachment for each team called "Logo".

    In a subform (PlayerStats <--- this is the "name" of the control; the subform is called "subfrmPlayerStats"), the image attachment is displayed based on what a combo box (column 1 of above table) in the same subform displays. It works perfectly. However, I want this image to be displayed on the main form (frmPlayerInfo) but keep the combo box in the subform. I tried copy and pasting the image control to the main form and changing the control source to =[PlayerStats].[Form]![Logo] but this does not work.

    Any ideas? Thanks for any help in advance.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I may not be following along with the process you used that is causing the trouble. Have you tried opening the form in design view and using the Wizard to add a new Attachment control?

  3. #3
    dotcanada is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2015
    Location
    Alberta, Canada
    Posts
    44
    In a subform, I have an image control ("Logo") that displays the logo based on what the combo box ("Team") is set at. It works fine within the subform. However, I want this same image control to be on the Main form instead of the subform and still change based on the combo box in the subform. I added the image control using "Add Existing Fields" option to the main form, but it doesn't update.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe there is some code in the afterupdate event of the combobox control in the original form that you can copy over to the new form.

    Can you post any VBA that may be existing in the original form and also the name of the combo.

  5. #5
    dotcanada is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2015
    Location
    Alberta, Canada
    Posts
    44
    This is what I have in the combo box after update event in subfrmPlayerStats:

    ---------------------------------
    Private Sub Team_AfterUpdate()
    Me.Refresh
    Me.Parent.Refresh
    End Sub
    ----------------------------------

    "Team" is the name of the combo box.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Do you have multiple attachments in any of the records? In other words, are there multiple logos for any given team (record)?

    I would suggest using my suggestion in post #2, insuring the use of the attachment control as opposed to the image control or a bound control. Alternatively, you could use the field list to drag a new and appropriate type control to your main form.

    I notice in post #1 you mention insuring the control source is correct. I suspect this is the smart place to look. Creating a new control should rectify any issues, provided your form is bound to the correct table.

  7. #7
    dotcanada is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2015
    Location
    Alberta, Canada
    Posts
    44
    Quote Originally Posted by ItsMe View Post
    Do you have multiple attachments in any of the records? In other words, are there multiple logos for any given team (record)?
    No, it's just the one attachment.

    Quote Originally Posted by ItsMe View Post
    I would suggest using my suggestion in post #2, insuring the use of the attachment control as opposed to the image control or a bound control. Alternatively, you could use the field list to drag a new and appropriate type control to your main form.
    I guess I'm a little confused when you say attachment control vs. image control. What I did was I clicked and dragged the attachment field (called "Logo") using "add existing fields" from tblTeams in design view but this didn't work.

    Quote Originally Posted by ItsMe View Post
    I notice in post #1 you mention insuring the control source is correct. I suspect this is the smart place to look. Creating a new control should rectify any issues, provided your form is bound to the correct table.
    I wasn't sure if it was correct. But it didn't work. Remember that this whole thing works in the subform, but if I cut and paste the attachment control (this is bound to the tblteams table) to the main form, no images show up based on what the combo box shows in the subform.

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    If you dragged "Logo" onto the design surface of your form and "Logo" is of type Attachment, Access will add an Attachment control.

    Something else is missing. Considering the code associated with your combo, nothing that your combo is doing will have an affect on your Attachment control, regardless of the Attachment control residing on the subform or main.

    That leaves what your main form is bound to. What is the control source of your main form? Can you post properties for your subform's Link Master Fields and Link Child Fields? Link fields are found under the data tab of your subform control's property sheet.

    BTW, I need to go to some meetings and will be away for a while. I will try to check back in when I get the chance.

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

Similar Threads

  1. Multiple Copies
    By billybeer in forum Reports
    Replies: 2
    Last Post: 08-10-2015, 02:11 PM
  2. Replies: 3
    Last Post: 07-13-2015, 12:07 PM
  3. Copies of database
    By buckwheat in forum Access
    Replies: 2
    Last Post: 09-17-2013, 02:23 PM
  4. Replies: 2
    Last Post: 10-10-2011, 10:58 AM
  5. Replies: 1
    Last Post: 07-31-2010, 11:50 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