0

I'm trying to create a database that is user friendly. So far I've developed two forms. Form 1 shows an overview of orders. Form 2 shows the details of a specific order. Form 2 is build on a query that retrieves information from different tables.

When I open form 2, a parameter input dialog box appears asking me which ordernr he has to look for. When I type in a number, the specific details from that record are shown.

Now comes the tricky part. form 1 shows the overview. When i click on an ordernr a textbox is filled. I did this to confirm the program reads the right number.

My question: How do I get the number from my textfield in form 1, into the parameter input dialog in form 2? The numbers are stored as text so no conversion is needed.

I saw a lot of solutions with DoCmd.OpenForm "Formname" ,,,,,, OpenArgs. I do believe this can be the sollution. I just don't know how to get OpenArgs into the Parameter Input Dialog.

Thanks for helping!

Fionnuala
  • 90,370
  • 7
  • 114
  • 152
  • 1
    Why do you want to use OpenArgs rather than Where? Is the code running on form1? If so, just use `Me.NameOfFieldOrControl`, if the record has focus, you do not need a textbox. – Fionnuala Apr 11 '14 at 10:23

1 Answers1

0

Change the query of the second form to have the value of the text box that you populate as a filter on the ordernr field. You might also to set the 'Modal' property of the second form to 'True' as this will prevent (or hinder at least) unsynced forms.

craig.white
  • 401
  • 2
  • 8