Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a search for a record

Status
Not open for further replies.

jnp102

Technical User
Mar 22, 2004
19
US
Hi All,

I'm kind of in a bind here and hoping that you guys can help. I have a form that lists 2 pieces of info from one table and I want to be able to have either a button or something out to the right of each line to find a record on another form. Let me explain another way.....So basically the form looks like this....

Issue ID Resource ID
1113 9999 button
1112 9999 button

and I want to be able to hit the button and it go to a seperate form and find the record that is associated with proper Issue ID. Hopefully this makes some sense what I'm trying to do here.


Thanks in advance

jnp102
 
Try this:

Code:
DoCmd.OpenForm "Put the name of form that you want to open here", , , "[Issue ID] = " & Me.Issue_ID, , acDialog

Note: The "Me.Issue_ID" is the name of the field that is linked to the Issue ID in your table. This field is located on your main form.

Good luck

----
Alex

Anytime things appear to be going better, you have overlooked something.
 
jnp102

Here some code typical to the way I handle yoru problem. You can generate similar code by using the wizard that is run when placing a command button to open a form...

Code:
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "MemberFrm"
    
    stLinkCriteria = "[MemberID]=" & Me![MemberID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    
    Me.stmemberID.Requery

The "link criteria" is basically a "WHERE" clause. You can also use the OpenArgs.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top