We help IT Professionals succeed at work.

Calling a function in another form

wendeenelson
wendeenelson asked
on
2,503 Views
Last Modified: 2013-11-28
I have a database GUI that I am building for order entry.  There are 3 main screens.  

Customer SWX: F(x) >> Search for customers, create customers, view their details, and start an order.
Order SWX: F(x) >>  List the order history of the customer that was selected, create a new order, edit an order, or remove an order.
Create Order:  F(x) >> Select the items to be ordered, the quantity, and save to the order table.

All of that works fine.  But what I want is the ability to finalize the order.  This will sum the order total and save the total in my order table.  That works too.  However, I cannot get it to update the Order SWX list box of orders by the selected customers.

I am loading the rowsource via VBA, not a Table/Query within the form.  How do I requery that listbox on the Order SWX screen from the Create Order screen?
Comment
Watch Question

You could put the function into a module (which is global) and then (provided its public) you can call it from any form.

I'm sure there must be a way to do something like this too:

    Application.Forms("formname").FunctionName(blah)

...but I haven't worked it out yet!

Author

Commented:
That is what I had in mind to.  But I don't know how to make it work.

Author

Commented:
That did not work.
I just tried this and it works:

    Call Forms("form2").moveBox

code in form1!!!
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
That works!!!

Thank you thank you!!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.