Open Form based on entry in another form

Hey Lucy

Registered User.
Local time
Today, 02:44
Joined
Jan 20, 2012
Messages
124
Hi, I am strictly an Access user and do not know SQL or VB or anything, so everything I do has to be done through Access. I don't know if this is possible, but I would think it would be.

I need to open a form based on the entry in a form field in another form. In other words, basically...I have a form that has a field -- Tasks Completed-- I need to be able to set up that field so that if the answer is Yes, it will open another form. Can this be done? How would I do it from Access?

Thanks!
Sherry aka Lucy
 
I would recommend making that field on the form a drop down box and then use code to open a new form based on the data in that form.

Something like:

Code:
Private Sub [COLOR=deepskyblue]Combo1[/COLOR]_AfterUpdate()
    If [COLOR=deepskyblue]Combo1[/COLOR].Value = "Yes" Then
        DoCmd.OpenForm "[COLOR=deepskyblue]yourformname[/COLOR]", acFormNormal, , , acFormPropertySettings, acWindowNormal
    End If
End Sub

Basically, make a combo box with options of Yes or No. Then click on the "Event" tab of the property sheet, make sure you have your combo box selected on the form. Then click where it says "After Update" and click "Code" or "Event Procedure".

Paste the code above in there. Replace the blue sections with your controls name and form name.
 
Last edited:
Yes, you can use the OpenArgs argument to pass that value to the second Form..
DoCmd.OpenForm "FormName", _
OpenArgs:="TheValue YouNeedToSend"

Forget what I said, misread the original post..
 
Last edited:
Thanks anyway Paul. I do appreciate the response. I figured this one out finally...I just attached a macro to the field and it worked perfectly.
 

Users who are viewing this thread

Back
Top Bottom