Open subform to specific record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to create a macro to open a subform to the record that was
double-clicked.

I've got a macro set on the OnDblClick property as follows:

Action: OpenForm
Form Name: Reservations_subform
Where condition:
[Reservations]![ReservationID]=[Forms]!Reservations_subform[ReservationID].form

What I want it to do is when you double-click on the Reservation ID in the
subform datasheet, it opens the subform in form view to that specific record.
What the above macro does is open a parameter box. If I enter the
Reservation ID number into the parameter box, it opens the correct record.
However, I don't want that extra step in there (the parameter box). Is there
a way to avoid this?
 
Miranda,

If you mean to open, in Form view, the same form that you are using as
the subform... hmmm, I wouldn't do it like that.

Anyway, the syntax is wrong in the Where Condition argument of the
macro. If I understand you correctly, it should be like this...
[ReservationID]=[Forms]![NameOfYourMainForm]![Reservations_subform]![ReservationID]
 
Thanks. Works perfectly.
--
Miranda


Steve Schapel said:
Miranda,

If you mean to open, in Form view, the same form that you are using as
the subform... hmmm, I wouldn't do it like that.

Anyway, the syntax is wrong in the Where Condition argument of the
macro. If I understand you correctly, it should be like this...
[ReservationID]=[Forms]![NameOfYourMainForm]![Reservations_subform]![ReservationID]

--
Steve Schapel, Microsoft Access MVP
I'm trying to create a macro to open a subform to the record that was
double-clicked.

I've got a macro set on the OnDblClick property as follows:

Action: OpenForm
Form Name: Reservations_subform
Where condition:
[Reservations]![ReservationID]=[Forms]!Reservations_subform[ReservationID].form

What I want it to do is when you double-click on the Reservation ID in the
subform datasheet, it opens the subform in form view to that specific record.
What the above macro does is open a parameter box. If I enter the
Reservation ID number into the parameter box, it opens the correct record.
However, I don't want that extra step in there (the parameter box). Is there
a way to avoid this?
 
Back
Top