Linking forms

M

mikeinohio

I have a form that has 25 text boxes to enter data; what i would like to do
is have a command button that would open a form that opens a new evaluation
form for that employe but i want the form to already have certain info
already filled out from the original employee record without me havng ot
search for that employee using a combo box, is this possible and how is it
done?
 
R

ruralguy via AccessMonster.com

Use the OpenArgs argument of the OpenForm command to pass as many pieces of
data as you want. Just separate them with a common character such as a ";".
Then use the OnLoad event of the next form to Split() out the various
elements and put them in the proper control. Post back if you need further
assistance.
 
R

ruralguy via AccessMonster.com

Sorry, You would setup the passing argument like:
Dim MyArgs As String
MyArgs = Me.txtFirst & ";" & Me.txtLast & ";"
MyArgs = MyArgs & txtEmpNumber & ";" & Me.txtPhone

Then open the next form with:
DoCmd.OpenForm "NextForm", , , , acFormAdd, , MyArgs

...Then in the "NextForm" OnLoad event put something like:

Private Sub Form_Load()
Dim Args As Variant

If Not IsNull(Me.OpenArgs) Then
Args = Split(Me.OpenArgs, ";")
Me.txtFirstName = Args(0)
Me.txtLastName = Args(1)
Me.txtEmpNum = Args(2)
Me.txtPhoneNum = Args(3)
End If

End Sub

...using *your* control names of course.
you totally lost me there...could you give a simple example?
Use the OpenArgs argument of the OpenForm command to pass as many pieces of
data as you want. Just separate them with a common character such as a ";".
[quoted text clipped - 8 lines]
 
Top