Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8464147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:39:10+00:00 2026-06-10T14:39:10+00:00

Ok so i have this situation where i need to dynamically open a form,

  • 0

Ok so i have this situation where i need to dynamically open a form, see code below, and, if possible, execute a known method for that form.

Open Form Method:

Public Sub ShowForm(par As Form, nm As String)
    DoCmd.OpenForm nm

    While IsOpen(nm)
        DoEvents
    Wend

End Sub

Caveat:

Not all forms will have the same method. So if possible add an additional optional parameter to pass through the method call, probably as a string value.

Some examples:

Form1:

public sub InitItem(id as string)
 ....
end sub

Form2:

public sub InitCategory(id as string)
 ....
end sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:39:12+00:00Added an answer on June 10, 2026 at 2:39 pm

    How about going mad?

    Private Sub Form_Open(Cancel As Integer)
        Cancel = Not BuildForm(Me.Name, True)
    End Sub
    
    
    Function BuildForm(strFormName, blnRS, Optional strParent = "None", _
                    Optional strSubname = "", Optional strParentS = "", _
                    Optional NameMod = "", _
                    Optional strFormReport = "Form") As Boolean
    

    OpenArgs, some notes

    If Me.OpenArgs & "" = "" Then
        Cancel = True
        Exit Sub
    End If
    
    astrOpenArgs = Split(Me.OpenArgs, ",")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where I need to generate the below XML dynamically in
I have this situation: $(#button).toggle(function(){ $(#window).animate({top:'0%'},1000); },function(){ $(#window).animate({top:'-100%'},1000); }); but I need change it
Using this file as source, I have a situation where I need to retrieve
I have this situation: There are a login page with a login form (form
I have a situation whereby, i need to create buttons dynamically and i need
In a Flex Mobile Application, I have a situation where I need to dynamically
My situation is: I have a project that scan a directory of libs. This
In my code, I have a situation where I need to copy data from
I have a situation where I need to dynamically disable certain controls. I will
I have a situation where I need to dynamically load a URL prefix. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.