Search for record based on form entry when recordset is query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • walshm
    New Member
    • Apr 2014
    • 4

    Search for record based on form entry when recordset is query

    Good morning!

    I am using Access 2007. I have two forms that are for other users to enter data.

    Form 1 is strictly a "search" type form. There are two command buttons to allow the user to search by idea number or project number. Once the user enters the appropriate number they click the command button and the following code executes:

    Code:
    Private Sub Command5_Click()
    
    DoCmd.OpenForm "Project Contacts", , , "[Idea Number]=" & Me![Text1]
    Me.Text1 = ""
    Me.Refresh
    DoCmd.Close acForm, "ProjectSearch ProjContacts"
    
    End Sub
     
    
    Private Sub Command6_Click()
    DoCmd.OpenForm "Project Contacts", , , "[CCR]=" & Me![Text3]
    Me.Text3 = ""
    Me.Refresh
    DoCmd.Close acForm, "ProjectSearch ProjContacts"
    End Sub
    This code works perfectly when the DATA FORM opening has a recordset of a table. However, I have some forms that use a recordset of a query. This is where I'm running into trouble.

    Is there a way to have the "DATA FORM" open for only the record indicated on by "SEARCH FORM" when the recordset of the "DATA FORM" is a query?

    Attached are examples of what the forms look like.

    Thank you!
    Attached Files
    Last edited by Rabbit; Apr 9 '14, 04:30 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    When you say you are running into trouble, what are you meaning? Do you get an error message?

    Comment

    • walshm
      New Member
      • Apr 2014
      • 4

      #3
      Seth,

      I'm not able to see your reply on the board for some reason however, I'll answer from the inbox response I got. So if there was more to your reply, I apologize!

      When I say I'm having trouble, the DATA FORM opens, but it opens blank, rather than opening for the record indicated in the SEARCH FORM. No errors are throwing...it's simply opening blank.

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        walshm:

        Comment out Line 4 and line 13 and try opening the forms that use a query and see if this helps any... - this is only a hunch as I don't have time today to check this in my test database (^_^)

        ALSO:

        If the images you have are of the standard jpeg/gif/bmp format, there is no need to enclose them in a document.

        You can upload these directly using the advanced post editor the same way you uploaded the docx file.

        Please understand, many of us cannot or will not d/l un-requested attachments. This has absolutely nothing to do with who you are... In my case, such d/l are prohibited by my ITSec staff. For many others, it is part of "safe computing/best practices" not to d/l such files. A practical example as to why can be found here http://bytes.com/topic/access/answer...l-ms-products. this unfourtunate Member opened a file from a trusted source and is now haveing all sorts of issues!

        Comment

        Working...