Quick check with a second form

  • Thread starter samotek via AccessMonster.com
  • Start date
S

samotek via AccessMonster.com

In my form Form1 i want to open a second form , Form2, but showing only the
row where the focus is for example the field Productcode from the first form
to show the same field Productcode from the second form.How to do it
automatically when changing the focus in the first form?
 
J

Jack Leach

Open the second form using the DoCmd.OpenForm method, and set the Where
clause argument to restrict records to the currently selected record. For
instance, assuming you have a numeric ID in a field on the main form that is
called fldID, the where clause for the DoCmd.OpenForm method would look like
this:

"fldID = " & Me.fldID


hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
S

samotek via AccessMonster.com

ruralguy said:

Thank you for your link. It works excellent. I have made a popup form and it
shows the data for the first row in the focus. How can i move through the
first form clicking different rows and showing the corresponding data in the
second form? Also, when shall i close the second pop up form?
 
P

Paul Shapiro

samotek via AccessMonster.com said:
Thank you for your link. It works excellent. I have made a popup form and
it
shows the data for the first row in the focus. How can i move through the
first form clicking different rows and showing the corresponding data in
the
second form? Also, when shall i close the second pop up form?

Maybe a subform is more appropriate? You can embed the second form on the
first form. On the subform control's property sheet, data tab, set the
Master Link Fields and Child Link Fields to the field name(s) that match a
main form row to the child form rows. So if I had a main Customer form and
wanted to see the customer's Orders, I would make a subform for the orders
and the link fields would be set to "customerID".
 
S

samotek via AccessMonster.com

I have done this, but the form opens in the first row only.Maybe i must put
the command in the on current instead in the onopen event? Also, when shall i
close the pop up form, since it remains open ?
 
S

samotek via AccessMonster.com

Yeas! thank you ! with subform it is much better and easier ! I solved my
problem with your help
Paul said:
[quoted text clipped - 11 lines]
the
second form? Also, when shall i close the second pop up form?

Maybe a subform is more appropriate? You can embed the second form on the
first form. On the subform control's property sheet, data tab, set the
Master Link Fields and Child Link Fields to the field name(s) that match a
main form row to the child form rows. So if I had a main Customer form and
wanted to see the customer's Orders, I would make a subform for the orders
and the link fields would be set to "customerID".
 

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