Results 1 to 3 of 3
  1. #1
    white_flag is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    26

    combobox take an activepath from column 2

    Hello again

    I like to change an picture based on selection from an combobox


    in Combobox I would like to see just the title (column1) but the imagine to take data from column 2 - where is stored the path to imagine:
    this is the code from VBA:
    Code:
    Private Sub Combo3_Change()
        'Me.Image0.Picture = CurrentProject.Path & "\" & Me.Combo3.Column(2)
        Me.Image0.Picture = Me.Combo3.Column(2)
    End Sub
    Private Sub Form_Load()
        'Me.Combo3.RowSource = "SELECT imagini.imagineID, imagini.titlu, imagini.cale_imagine FROM imagini ORDER BY [titlu]"
        Me.Combo3.RowSource = "SELECT imagini.imagineID, imagini.titlu," & Application.CurrentProject.Path & "\" & "[cale_imagine] AS Expr1 FROM imagini ORDER BY [titlu]"
    End Sub
    the error is on this line
    Code:
        Me.Combo3.RowSource = "SELECT imagini.imagineID, imagini.titlu," & Application.CurrentProject.Path & "\" & "[cale_imagine] AS Expr1 FROM imagini ORDER BY [titlu]"
    syntax error missing operator.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Trick is getting apostrophe delimiters and concatenation right. Try:
    "SELECT imagineID, titlu, '" & Application.CurrentProject.Path & "\' & " & "[cale_imagine] AS Expr1 FROM imagini ORDER BY [titlu]"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    white_flag is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    26
    thx mate. it is working preaty nice

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

Similar Threads

  1. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  2. Replies: 1
    Last Post: 08-09-2011, 06:07 PM
  3. Replies: 6
    Last Post: 07-28-2011, 04:07 AM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 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