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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using Hyperlink to open a form and find/create record

Status
Not open for further replies.

griswom

Technical User
May 13, 2002
40
US
Hi All,

First time post on this forum. Thank you in advance for any assitance. Here is my problem. I have a form which opens in data sheet view called "Claims". Each claim number is a hyperlink which pulls up a form called "Claim Notes" at the "On Click" event. It is after the form opens that I am stuck. Ideally, the form would search for the record in "Claim Notes" that corresponds to the claim number from the "Claims" form. If such a record exists it would go to that record. If it does not yet exist, the form would create a new record on the "Claim Notes" table using the claim number from the active record on the "Claims" table. Any ideas on how this can be accomplished would be appreciated. Thank you.

Griz
 
Attach form to a query that has criteria set to the ID you want to display. Use the condition property of OpenForm to open the form at the correct place.

e.g.

Dim Condition as String
Condition = "[ClaimNo] = Forms![Form1]![ClaimNo]"
DoCmd.OpenForm "Form2", , , Condition

where Form1 is the origina form, Form2 is the one you want to open and [ClaimNo] is the field or control that has the current claim no selected.
Have fun! :eek:)

Alex Middleton
 
Alex,

Thank you. That worked beautifully.

Griz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top