I hope I'll get it right
docmd.OpenForm "Transaction Detail",,,"[Exchange No]= '" & me.[Exchange No]
& "'"
:
So far, I have the Command Button opening the subform ("Open Form"), then
opening the new form (this is where the problem is - form name to open is
"Transaction Detail") and then closing the subform. It is doing everything
correctly, except that is goes to the first record, not the selected record.
Under 'Open Form' for the new form, I have:
Form Name: Transaction Detail
View: Form
Where Condition: [Forms]![TransTable Query Subform]![Exchange
No]=[TransTable]![Exchange No]
Data Mode: Edit
Window Mode: Normal.
(There is nothing under "Filter Name").
Thanks very much!
:
post the code you wrote, the name of the field in the form you want to use as
the filter, the name of the form, the name of the field in the table that the
second form is bounded to.
me stand for the form Im currently working with
:
I so want this to work, but it does not. The field type is a string, by the
way. I tried this suggestion with several variations, but to no avail. What
does the "me" portion of the phrase do?
:
try that, enter the where condition in the open command
' If the field type is number
docmd.OpenForm "FormName",,,"[FieldNameInTable]= " & me.filednameinform
' If the field type is string
docmd.OpenForm "FormName",,,"[FieldNameInTable]= '" & me.filednameinform & "'"
' If the field type is date
docmd.OpenForm "FormName",,,"[FieldNameInTable]= #" & me.filednameinform & "#"
:
How do I create a command button in a form (#1) that will open a different
form (#2) of a selected record on a subform within form #1? (I understand
how to instruct it to open the form, but I don't understand what the Action
Command is that tells it to go to the SELECTED record). (The subform has
multiple records, which are shown in Datasheet View. I want it to go to the
form of the one I have clicked on). Thanks.