+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20

Thread: movie database

  1. #16
    Valued Forum Contributor alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Lake County, Illinois
    MS-Off Ver
    MS Office 2010, 2007 and 2002
    Posts
    1,161

    Re: movie database

    I think that I may have fixed it using the information in the KB you supplied. Nice finding. I've attached. Look at the query. I think that you may not have clearly understood the KB.

    Alan
    Attached Files Attached Files

  2. #17
    Registered User
    Join Date
    11-07-2009
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: movie database

    ok I have a few more questions:

    1st - I want to set the column widths that display on the datasheet that opens when I view all my database entries or view the search results.
    I found the following code
    Forms![FormName].ColumnWidth = -2
    which is supposed to set the column width to be the same as the largest text entry.
    The site I got the code from says that we use it in the OnLoad event but I cannot see the datasheet itself in my vba code viewer.
    Can someone explain how I can do this pls?


    2nd - I want to lock the datasheets from being able to be edited by anyone when viewing but would also like to have a way to have an editable record as well - so an edit button on the main menu.
    How can I do this - I have been searching for ages and cannot find anything to help me.

  3. #18
    Registered User
    Join Date
    11-07-2009
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: movie database

    Alan,
    Thanks for that, I have had a look at the database you attached and run some test searches however it is still returning the same incorrect search results as my original search criteria:
    * When searching by volume it returns all results.
    * When searching by title it returns the results that match the search string but also returns any empty rows as well.
    * When searching by rating it also returns the relevant results PLUS any empty rows as well.

  4. #19
    Registered User
    Join Date
    11-07-2009
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: movie database

    Alan,
    Thanks for that, I have had a look at the database you attached and run some test searches however it is still returning the same incorrect search results as my original search criteria:
    * When searching by volume it returns all results.
    * When searching by title it returns the results that match the search string but also returns any empty rows as well.
    * When searching by rating it also returns the relevant results PLUS any empty rows as well.


    If you run some test searches on the last database that I attached I hope that you will find - as I did - that the search problems have been resolved.
    All of my searches are now returning correct results.
    Last edited by vampyr07au; 04-22-2011 at 03:11 AM. Reason: sorry for the duplicate post

  5. #20
    Registered User
    Join Date
    11-07-2009
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: movie database

    this thread is now complete and all issues solved. I ended up using the following code for the search button:

    Private Sub Command7_Click()
      
        Dim strCriteria As String
      
      If Len(Me.Volume & vbNullString) > 0 Then
        strCriteria = strCriteria & "[Volume] = " & Me.Volume & " AND "
      End If
      
      If Len(Me.Title & vbNullString) > 0 Then
        strCriteria = strCriteria & "[Movie Title] LIKE '*" & Me.Title & "*' AND "
      End If
      
      If Len(Me.Rating & vbNullString) > 0 Then
        strCriteria = strCriteria & "[Rating] = '" & Me.Rating & "' AND "
      End If
      
      If Len(strCriteria) < 1 Then
        MsgBox ("Please enter search criteria before attempting to search the database")
      Else
        strCriteria = Left(strCriteria, Len(strCriteria) - 5)
        If DCount("*", "search", strCriteria) = 0 Then
          MsgBox "No movies matching your search. Please refine your search and try again."
          Exit Sub
        Else
          DoCmd.OpenForm "search results"
        End If
      End If
    
    
        End Sub
    Hopefully this might help someone else.

    All the "like" criteria that allow the searches to be done with parial entries are found in the query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0