Issues: DoCmd.OpenForm

phiednate

Registered User.
Local time
Today, 14:41
Joined
Jul 16, 2009
Messages
17
I may have bit off more then I can chew on this one but I am getting really close to having something that is usable. Here is my question:

I have a form names Contract Search where I have implemented The "Cool Search Tool" from this post:

http://www.access-programmers.co.uk/forums/showthread.php?t=116253

I set it up so that the query pulls info out of 3 tables that are set up with relationships. I have a Contracts table that has the specific contract information and an Administrator and Customer tables that relate to the contracts.

What I am trying to do is set up buttons that will pull up the details of the specific contract when clicked. I got it to work for the Contract table but Administrator and Customer wont work. This is what I have for contracts:

Code:
Private Sub Command73_Click()
  Dim stDocName As String
  Dim stLinkCriteria As String

  stDocName = "Contracts"
  stLinkCriteria = "[Contracts].[Contract Number] = '" & Me![QuickSearch] & "'"

  DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
My thought is that based on my query, the data that is stored in "QuickSearch" is really the contract number. The following is my info for the table:

Code:
Private Sub QuickSearch_AfterUpdate()
    
DoCmd.Requery
Me.RecordsetClone.FindFirst "[Contracts].[Contract Number] = '" & Me![QuickSearch] & "'"
If Not Me.RecordsetClone.NoMatch Then
   Me.Bookmark = Me.RecordsetClone.Bookmark
Else
   MsgBox "Could not locate [" & Me![QuickSearch] & "]"
End If

End Sub
I am gonna keep on searching and reading the forums but it seems like I have been at a dead end for the past hour or so. Any ideas would be helpful. Thanks!
 
It's not a good idea to have space characters in your names. I find things work better if I avoid their use.
 

Users who are viewing this thread

Back
Top Bottom