You’re using a Continuous Form, you can’t fit all your fields on the Form but you need to see and/or edit the record and you don’t want to use a Command Button. (Sample file located at the bottom of the article.) Here’s an alternate way to open the record with a Field…
a. Put an UNBOUND field on your Form and enter the below as the Control Source (Figure 1). Note, where cpClientID is my Autonumber and Primary Key you should replace with your Autonumber and/or Primary Key…
=IIf(IsNull([cpClientID]),"(New)","Open")
b. In the Properties Sheet window for your Field set the Display As Hyperlink to Always. Note, you can leave the Font Color as Hyperlink Color or change to any color you like. However, since most Users are accustomed to the blue it is safer to accept the default Font Color of Hyperlink Color.
c. Now, just add a bit of code the On_Click event to open your details form (See sample of my frmClientProfile below)…
If (IsNull(txtClientID)) Then 'If the Field displays (New) DoCmd.OpenForm "frmClientProfile", , , ,acFormAdd Else 'If the Field displays Open DoCmd.OpenForm "frmClientProfile", , ,"[cpClientID]=" & Me![txtClientID] End If
To download a sample file click here…