Minggu, 19 Oktober 2014

Re: [MS_AccessPros] Open second form within first form not using button. Access 07

 

I totally agree with John, however, I wonder why you think that the users will always be able to type the word "Vehicle" correctly every time.  Given the original message, its clear to me that there's a definite number of subforms that may be displayed.  I'd use a combobox or listbox in place of a textbox and then would place the test to open the subform in the AfterUpdate Event as John suggested. This would ensure that the users actually get the criteria used to display a subform correct.


From: "Kambiz Afshartous kenaf42@yahoo.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: "MS Access Professionals" <MS_Access_Professionals@yahoogroups.com>
Sent: Sunday, October 19, 2014 2:17:08 PM
Subject: Re: [MS_AccessPros] Open second form  within first form not using button. Access 07

 

John Thank you very much
 
Kambiz


On Sunday, October 19, 2014 3:23 AM, "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:


 
Dear kenaf42 (name?)-

It would be better to use the AfterUpdate event of the control.  The code will look something like this:

Private Sub PaidFor_AfterUpdate()

    ' If user entered "Vehicle",
    If Me.PaidFor = "Vehicle" Then
        ' Open related form
        DoCmd.OpenForm "Name Of Other Form"
    End If

End Sub


John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Oct 19, 2014, at 12:58 AM, kenaf42@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I need VBA code to open second form when curser leaves (on Exit) certain Text Box on first form.
Example:
Form A "expenses" has text box "Paid For" if user type VEHICLE in this box on EXIT I would like for Form related to vehicles open. All forms are popup.
I do not want using a button.







--
---

Jeffrey Park Jones
Excel, Access, Word, Office Expert
Excel and Access, LLC®
http://ExcelAndAccess.Com

919-671-9870
5109 Deer Lake Trail
Wake Forest, NC 27587
jpjones23@centurylink.net


__._,_.___

Posted by: jpjones23@centurylink.net
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

.

__,_._,___

Tidak ada komentar:

Posting Komentar