Every record in the table should be uniquely identified, ie the primary key. My
form is in continuous form view (to use the record selectors), but since the
primary key is an autonumber, I don't display it in the form, but it needs to be
on the form to be used in the criteria in (the Where clause) the DoCmd.OpenForm.
I hid it because it is not meaningful data (at least it shouldn't be!).
So I added a text box and set the control source to the primary key. You can
name the text box anything (OK, I admit it - I was too lazy to rename it), maybe
[CurrentRecordSelected] would be better than [Text32].
If I didn't explain it right, let me know....
HTH
--
Steve
--------------------------------
"Veni, Vidi, Velcro"
(I came, I saw, I stuck around.)
Steve:
Thanks for the code, that's exactly what I am looking for but I'm having a
problem with the Text32. What do I replace it with in my dbase?
Thanks!
Michelle
:
Michelle wrote:
I have a tabular form (PriContactInfo) I created that has
the basic client info in it. I click on a toggle button
corresponding the the first letter of the last name and
the clients that match the toggle button come up.
Now I want to be able to click on the record selector on
the left side, double click on it, and have it open up to
another form (ContactPersInfo) I created and match the
client info to the one that was selected.
Any help would be great!
Thanks!
Michelle
I used the record selector to open an edit form, also. Works great.
Here is the code I used :
' current form name is frmGC1ListPermits
' form to be opened is frmGC1PermitEdit
Private Sub Form_DblClick(Cancel As Integer)
On Error GoTo Err_Form_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmGC1PermitEdit"
stLinkCriteria = "[lngPermitID]=" & Me![Text32]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Form_DblClick:
Exit Sub
Err_Form_DblClick:
'MsgBox Err.Description
Resume Exit_Form_DblClick
End Sub
Me![Text32] is a hidden control that has the primary Key (linking field) for the
record to be selected in the record source of the form that will be opened.
HTH