Populating a form from a form

Muzicmn

Registered User.
Local time
Today, 00:42
Joined
Nov 3, 2002
Messages
78
Hey guys,

I have a problem which i have seen discussed here but none of the solutions seem to work for me.

What i want to do is simple. I have a form named frmName, this stores last name and first name. I have another form named frmAddress this one stores last name and address. What i would like to have happen is when the user clicks a button on the frmName form it opens frmAddress (to a new record) and copies the last name from frmName to frmAddress.last.

Code:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAddress"
stLinkCriteria = [last] = Forms!frmName!last
DoCmd.OpenForm stDocName, , , stLinkCriteria

the form opens correctly but no data appears on the frmAddress,

any ideas???

Thanks

Ricky
 
btw what would you do if you have many people with the same surname ?
 
that was just a simple example of what i am trying to accomplish. The data that is being copied is an employee id # and an item #....will search the db thanks for leading me in the right direction

Ricky
 
you're welcome ... if you will encounter any problems post back :)
 

Users who are viewing this thread

Back
Top Bottom