D
Dean Slindee
I have a search form (frmMailingSearch) that displays a grid of rows that is
a subset of the entire table. From that grid, the user may give focus to
the selector box of one row, and then click the Select button. I would then
like to show the row in the detail form, by going directly to it. The
detail form may or may not have been instantiated as yet. I want the detail
form to always have it's recordsource as the full underlying table, not just
the one row that we "goto".
The DoCmd.GoToRecord is not working as I want, because "MailingID" is not
actually an offset value, it's the key value of the row. Should I be using
a different cmd or structuring the offset value differently? This code is
in the frmMailingSearch.cmdSelect_Click event.
Dim frm As Form
Dim booFormFound As Boolean
booFormFound = False
For Each frm In Forms
If frm.Name = "frmMailing" Then
booFormFound = True
Exit For
End If
Next frm
If booFormFound = True Then
DoCmd.GoToRecord acDataForm, "frmMailing", acGoTo, MailingID
Else
DoCmd.OpenForm "frmMailing", acNormal
DoCmd.GoToRecord acDataForm, "frmMailing", acGoTo, MailingID
End If
I have also substituted .FindRecord for .GoToRecord, with passing syntax,
but no resultset. Any better ideas would be appreciated.
Thanks in advance,
Dean S
a subset of the entire table. From that grid, the user may give focus to
the selector box of one row, and then click the Select button. I would then
like to show the row in the detail form, by going directly to it. The
detail form may or may not have been instantiated as yet. I want the detail
form to always have it's recordsource as the full underlying table, not just
the one row that we "goto".
The DoCmd.GoToRecord is not working as I want, because "MailingID" is not
actually an offset value, it's the key value of the row. Should I be using
a different cmd or structuring the offset value differently? This code is
in the frmMailingSearch.cmdSelect_Click event.
Dim frm As Form
Dim booFormFound As Boolean
booFormFound = False
For Each frm In Forms
If frm.Name = "frmMailing" Then
booFormFound = True
Exit For
End If
Next frm
If booFormFound = True Then
DoCmd.GoToRecord acDataForm, "frmMailing", acGoTo, MailingID
Else
DoCmd.OpenForm "frmMailing", acNormal
DoCmd.GoToRecord acDataForm, "frmMailing", acGoTo, MailingID
End If
I have also substituted .FindRecord for .GoToRecord, with passing syntax,
but no resultset. Any better ideas would be appreciated.
Thanks in advance,
Dean S