Click in DataSheet to open form - Opening to 1st data entered in t

  • Thread starter Thread starter NDClark
  • Start date Start date
N

NDClark

I have a Datasheet Subform within a form. When I click data in the subform I
have a macro set to open another form to edit the data. However, the editing
form opens only to the first record.

I want to click on a piece of data in the subform and open my edit form to
work on that particular piece of data and save it to the table.

What am I missing here?
 
NDClark,

At a guess, what you are missing is the Where Condition argument of the
OpenForm action in your macro.

If that doesn't help, please post back with details of what you have there,
including the actions and arguments of your macro, the name of the form and
subform, and the event the macro runs on.
 
The original Form is Vehicle Information form. I placed a subform which is
a Datasheet at the bottom of the form with maintenance records for the
vehicle in it. I set a macro to open another form "Maint Record form" when I
click a maintenance record (data) in the Subform.

The macro is OnClick OpenForm - the argument is: Maint Record, Form, ,
[tblMaintRecord]![ID], Edit, Normal

The Where condition has nothing in it at the bottom. I am unsure what to
put there to open to the data on the datasheet.
 
NDClark,

I don't quite understand. From the information you gave, it appears that
the Where Condition argument has this:
[tblMaintRecord]![ID]
.... whereas you then say it has nothing there.

Anyway, I think it should be like this:
[ID]=[Forms]![Vehicle Information]![NameOfYourSubform]![ID]
(replace 'NameOfYourSubform' with the actual name.)
 
Thanks Steve! Yes, your code worked fine.

Steve Schapel said:
NDClark,

I don't quite understand. From the information you gave, it appears that
the Where Condition argument has this:
[tblMaintRecord]![ID]
.... whereas you then say it has nothing there.

Anyway, I think it should be like this:
[ID]=[Forms]![Vehicle Information]![NameOfYourSubform]![ID]
(replace 'NameOfYourSubform' with the actual name.)

--
Steve Schapel, Microsoft Access MVP


NDClark said:
The original Form is Vehicle Information form. I placed a subform which
is
a Datasheet at the bottom of the form with maintenance records for the
vehicle in it. I set a macro to open another form "Maint Record form"
when I
click a maintenance record (data) in the Subform.

The macro is OnClick OpenForm - the argument is: Maint Record, Form, ,
[tblMaintRecord]![ID], Edit, Normal

The Where condition has nothing in it at the bottom. I am unsure what to
put there to open to the data on the datasheet.
 
Back
Top