Passing variables across Access 2007 forms

Posted on 2014-08-24
Last Modified: 2014-08-24
Hello -- I am trying to pass a text variable from Microsoft Access 2007 form "frmMaster1," to "frmAddtopic" using the following code on the "on open" event of frmAddTopic:

    DoCmd.GoToRecord , , acNewRec

    If Not IsNull(Me.OpenArgs) Then
        Dim stTopic As String
        stTopic = Me.OpenArgs
        Me.Topic = stTopic
    End If

This is triggered by a "NotinList function from the TopicId field in FrmMaster1. No code shows up there though.

The value passes, but along with it I get form and field name, e.g.


Of course I just want the value. Any thoughts on how I might accomplish this?
Question by:jlouija
    1 Comment
    LVL 48

    Accepted Solution

    Try with this modification:

        Me.Topic = Split(stTopic, "=")(1)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now