Results 1 to 2 of 2
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    VBA opening another form

    1. The sales unit price for any item in the business that has a sales unit price, can be found on the salesprice list, and the app returns that as is expected on the Sales Invoice.


    2. Many income items does not have a sales unitprice, therfore it has to be captured manually.
    3. There is a button on the form that wil open the form f02SalesInvSubSub, as can be seen on the image, all work well.
    4. The wish is for VBA code through an event to open the form, "after update" on quantity. The button is unwanted.
    5. In the left bottom corner it can be seen that txtQuantityB2 is returned from the subform, to the main form.
    6. The VBA below is placed on the main form. I am missing what I do wrong, the VBA does not open the form.


    Private Sub txtQuantityB2_AfterUpdate()
    If Me.txtUnitPriceSaleD > 0 Then
    DoCmd.OpenForm "f02SalesInvSubSub"
    End If
    End Sub

    Click image for larger version. 

Name:	230507a.png 
Views:	19 
Size:	34.5 KB 
ID:	50212

  2. #2
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Gicu taught me something before. I applied that and it works.
    vcShowHideSubAccsfrm
    Me.Parent.f02JournalsSubAcc.Visible = Nz(Me.txtSubAccountA2, "No") = "Yes"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 04-21-2017, 11:23 AM
  2. Replies: 8
    Last Post: 03-20-2017, 07:22 PM
  3. Replies: 2
    Last Post: 11-22-2015, 07:24 PM
  4. Replies: 3
    Last Post: 03-11-2015, 08:05 PM
  5. Replies: 5
    Last Post: 01-24-2015, 12:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums