Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Passing variables across Access 2007 forms

Posted on 2014-08-24
1
Medium Priority
?
316 Views
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.

[frmMaster1]![TopicID]=value.

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

Accepted Solution

by:
Gustav Brock earned 2000 total points
ID: 40281657
Try with this modification:

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

/gustav
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…
Suggested Courses

810 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