Gareth,
I think the solution is much simpler. I'm assuming the only reason to open
the second form is to print the information in the first?
Assuming this is correct, my first suggestion would be to make the second
form a report and not a form, as these are design to be for printing, were
forms are not.(Have a look at the reports in the northwind database for
examples of how reports work).
Then in the button you are reffering to you would need something like the
following:
Docmd.openreport "TheReport",,,"[FormOneID]=" & Me![ReportID]"
This 'opens' the report which has the same primary id number as your form,
prints it then closes it.
If you want to see your report before you print it change the above to:
Docmd.openreport "TheReport",acViewPreview,,"[FormOneID]=" & Me![ReportID]"
Hope i have understood your situation correctly.
HTH
Rico
"gjoneshtfc@volcanomail.com" wrote:
> Hello
>
> I have never used VB before but have been asked to look at coding a
> button in Microsoft Access. The button currently exits a form and opens
> a new form and works great. However, when the new form opens i want it
> to open with information about the record i had open in the previous
> form.
>
> For example: I am looking at a record for everything to do with invoice
> number 50 in the first form. The second form is the invoice print
> layout that i open if i need to print the invoice information alone.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=5981
> When i click on the button in the first form i need to have invoice
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=5981
> number 50 open in the second form.
>
> Ideally i need to store the record number and then have it open in the
> next form - if this is possible??!! Alternatively i could store the
> stock number or invoice number and then have the button find the record
> in the next form. I have tried a few things but they all give errors or
> fail to work!
>
> Any help will be greatly appreciated.
>
> Regards, Gareth Jones
>
>