How To Switch To Correct Record When Switching Forms

bitsbb01

Registered User.
Local time
Today, 14:54
Joined
Apr 2, 2013
Messages
34
Hi all,
Well i'm in need of some help and just cannot seem to be able to work it out, i've looked all over and cannot seem to find an answer that will work...

Here's the problem

I have a form called "Customer Details", on that form i have child forms, including one that has a schedule on.. so far everything seems fine, am able to get it to pull data correctly to the correct fields.. etc

I'm using 1 main table for all of this called "Cases"

Now the problem is, when i i click a button to print (this works so far), it opens another form and then fills in all the textbox's, however this is where i've got the problem, as it always seems to pull the data from the first record, not the record that i'm currently on..

so for example, if in the customer details, someone looks up "joe Blogs" using the navigation search and then wants to print it, by hitting the print button .. it should open another form, fill in the boxs and print "Joe Blogs", however it's always doing "Joe adams" - 1st Record

Any Help would be greatly accepted..

Thanks in advance
 
Research the OpenArgs property of a Form.
If you get the Id of the Person you're looking for on the first form, then when you open the second form use the OpenArg with the appropriate value for the Person you've identified.
Here are some related links:
http://msdn.microsoft.com/en-us/library/office/aa160845(v=office.10).aspx
http://www.fmsinc.com/free/newtips/access/accesstip13.asp
http://www.baldyweb.com/OpenArgs.htm
http://www.datawright.com.au/access_resources/access_docmd.openform_arguments.htm
 
I figured out how to do it..
Was quite simple when thought about it..

on the print button leading to the next form.. i have

DoCmd.OpenForm "Printformbegin", , , "ID=" & Me.ID

this works excatly how i wanted it.. it pulls the information accross and is in the right record..

Thanks for the help..
 

Users who are viewing this thread

Back
Top Bottom