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

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?
 
S

Steve Schapel

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.
 
N

NDClark

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.
 
S

Steve Schapel

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.)
 
N

NDClark

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top