• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 435
  • Last Modified:

Access - Tabbed Form - Calling Public Sub from another Tabs Subfrom

Hello all,

I had a Private Sub that I made a Public Sub because I need to be able to Call it or Run it after I run some code on another Form via that Form's code...


This is a tabbed form which I think I now understand the coding of the name...... however
I can't get it to run the new Public Sub

The Public Sub is cmdSaveCtlTotals

This is being run from code on Parent.Page3 which is:
Forms![frm_DataReporting]![LVLReportingControlTotals_VerifyZero].Forms!

Parent.Page2 or
Forms![frm_DataReporting]![WVLVLControlTotals].Forms!
is where the Public Sub is

this is the offending code:
    Parent.Page2.SetFocus
    Forms![frm_DataReporting]![WVLVLControlTotals].Forms![cmdSaveCtlTotals]

Tried also
    Forms![frm_DataReporting]![WVLVLControlTotals].cmdSaveCtlTotals
0
wlwebb
Asked:
wlwebb
  • 2
  • 2
1 Solution
 
IrogSintaCommented:
Don't use the exclamation mark when calling a routine on another form.
Try this:
Call Parent.WVLVLControlTotals.Form.cmdSaveCtlTotals
0
 
wlwebbAuthor Commented:
I get
Run-time error 438
Object doesn't support this property or method...
0
 
IrogSintaCommented:
Make sure that Form is not plural.
Call Parent.WVLVLControlTotals.Form.cmdSaveCtlTotals
0
 
wlwebbAuthor Commented:
Irog

Thank you!  THAT WAS IT WITH ONE EXCEPTION.... which you would have never known because I screwed up......  the Public Sub is cmdSaveCtlTotals_Click

I have this "Verify" command button overtop of the cmdSaveCtlTotals command button and if the user inputs anything into one of the fields it hides the "Verify Zeros" command....  

So in my inept understanding I thought VB would ignore the _Click extension....

It works if all zeros!!   I'm going to double check that my cmdSaveCtlTotals command still works after I've made it Public......
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now