UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Open Form Carrying Forward Data, Office 2010    
 
   
badams2
post Apr 3 2012, 07:27 PM
Post #1

New Member
Posts: 3



Here is what I would like to do. I have a "client center" where you bring up the demo data on a client. On frm_cli_center, I have buttons to open 4 different forms. When a button is clicked, I would like it to open the form, carrying forward the empl_id of the current record on the client center. If that empl_id already exists, I want it to open with the data that was already entered. Any help?
Go to the top of the page
 
+
 
Start new topic
Replies (1 - 1)
hk1
post Apr 3 2012, 07:38 PM
Post #2

UtterAccess Veteran
Posts: 400



You should be able to pass the value in using the Opening Arguments for the form.

When you open the form:
CODE
DoCmd.OpenForm "frm_cli_center", acNormal, , , , ,Me!empl_id


And then on frm_cli_center Load event:
CODE
Private Sub Form_Load()
    If IsNull(Me.OpenArgs) = False Then
        Me.Filter = "empl_id = " & Me.OpenArgs
        Me.FilterOn = True
    End If
End Sub


Another more common way is to do this when you open the form:
CODE
DoCmd.OpenForm "frm_cli_center", acNormal, , ,"empl_id = " & Me!empl_id
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th May 2013 - 10:13 PM