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!

Open form to correct record from datasheet 1

Status
Not open for further replies.

MichelleB

Programmer
Feb 13, 2002
3
US
I want to have a user "double-click" on a field or two in a record in a form that is in datasheet view (actually it is a subform) and have an entirely different form open to that record. Any thoughts? I have tried using CurrentRecord in a few different ways, but it is not working????

 
Code behind the Double Click event.

Dim DocName As String, YourVariable as String, Quote as String
QUOTE = Chr$(34) '- double quote for text fields, numeric omit

YourVariable = Me.YourVariable
DocName = "YourForm"

WhereClause = " yourKey = " & QUOTE & YourVariable & QUOTE
DoCmd.OpenForm DocName, , , WhereClause

Make sure the form you are opening has allow filter on. This will open your form with the one record that you double clicked on. If you want all the records then just open without the filter (where clause).

Jerry
 
The WhereClause above should have been Dimmed as a string.
Dim WhereClause as String

Sorry if it caused a problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top