INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Calling one form from another form, use of CallByName.

Calling one form from another form, use of CallByName.

(OP)
Iam trying to open one form from another form, using CallByName, and to call a user-defined subroutine in the form that is being opened. I have gotten different error messages depending on the exact coding I am testing. The most recent one is error 424, for Object Required. I have an object variable call frmName, and it seems to be initializing correctly when its value is set, in this case to Forms("ORDERS"). However, I still get this error.

One of the end users sometimes gets an error, number Error Number -2147417848, indicating that a MoveNext command failed. As far as I can determine, this traces to issues involving late binding vs early binding. This is why I am looking at CallByName. Any thoughts as to the kind of syntax I should use, or any other thoughts on the problem?

Thank you in advance.

RE: Calling one form from another form, use of CallByName.


Not sure if this is your issue...The sub or function you are calling needs to be Public not Private

RE: Calling one form from another form, use of CallByName.

(OP)
It is public. That is one of the first things I looked at.

RE: Calling one form from another form, use of CallByName.

Do you have a sample of the callby name statement? Is the code that you are going to run from the other form something that could be made generic enough that you could put into a code module rather than the vba of the form?

RE: Calling one form from another form, use of CallByName.

Quote:

As far as I can determine, this traces to issues involving late binding vs early binding. This is why I am looking at CallByName.
That statement does not make sense to me. What does late binding have to do with the need to use call by name? Please provide any code. Call by name allows the end user to "modify" code at runtime, not sure that relates to late binding.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close