Results 1 to 11 of 11
  1. #1
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115

    Ricerca cd

    Hello everyone, I have a little problem ... I created (using a base found on the internet) a small database of CDs.


    I have a mask "Ricerca_cd" within which there is a list consisting of the field IDCD-Artist-Title-clicking on the title I Numero_cd that opens another form "scheda_cd" containing information on the CD itself through this code


    If Not IsNull (Me.cmbCd) Then
    DoCmd.OpenForm "Inserting / modifica_cd" acNormal, "", "[IdCd] = [Forms]! [Ricerca_cd]! [CmbCd]," acEdit, acNormal
    If end


    All this works ... I would now like to make sure that as soon as you select a title, I get on the mask Ricerca_Cd "in the left pane, a field called" review ", but I do not know how to do .. could you help me?
    thanks
    Hello

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Don't know what you mean by 'mask'.

    The code you show has quote mark in the wrong place and missing a comma between first two arguments and cannot work.
    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
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Hello, basically I have a list of data including "IDCD" and I wish that every time I click on a name, I appear in a text box as a "review" on this same record.
    Eg. if I have the following record
    1 Pink Floyd The CD was recorded in 1999
    I would like in the text box by selecting the words "Pink Floyd", appeared in the second text box "The CD was recorded in 1999"
    thanks Hello

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You want to retrieve record? Do you want to filter the data on form that has the combobox or do you want to open another form?

    1. to apply filter to form:
    Me.FilterOn = False
    Me.Filter = "[IdCd] = " & Me.[CmbCd]
    Me.FilterOn = True

    2. to open another form filtered to record
    DoCmd.OpenForm "Inserting / modifica_cd", acNormal, , "[IdCd] = " & M.[CmbCd], acEdit, acNormal
    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.

  5. #5
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Thank you!
    I need
    1. to apply filter to form:
    Me.FilterOn = False
    Me.Filter = "[IdCd] = " & Me.[CmbCd]
    Me.FilterOn = True


    It gives me an error: "data types do not match in criteria expression" and I highlight in yellow Me.FilterOn = True

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    There is nothing wrong with code syntax. Where did you put the code - button Click event? Post your procedure code or the database. Follow instructions at bottom of my post.
    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.

  7. #7
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Thanks
    Private Sub cmbCd_Click()
    Me.FilterOn = False
    Me.Filter = "[IdCd] = " & Me.[cmbCd]
    Me.FilterOn = True
    End Sub

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I see nothing wrong with code. Will have to examine db.
    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.

  9. #9
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Cd1.zip here is the file

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    IDCD is text field, not number. Text requires apostrophe delimiters:

    Me.Filter = "[IdCd] = '" & Me.[cmbCd] & "'"

    Also, need to fix code in Visualizza_Click() procedure:

    DoCmd.OpenForm "008_msc", acNormal, , "[IdCd]='" & Me.[cmbCd] & "'", acEdit, acNormal

    Run Debug>Compile and you will encounter another bug in code.
    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.

  11. #11
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    1000 Thanks

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

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