VBA Passing text box value from one form to another text box in another form

Posted on 2009-12-16
Last Modified: 2013-12-20
I am having difficulty (probably me being thick) passing the value of a text box in one form to another text box in the next form. Basically the idea is that the user can see the user id and name for each form and doesnt forget what record he is inputting for.
The code for the first text box input seems to work OK.

Public Sub SIPPNo_AfterUpdate()
SIPPNumber= SIPP.No.Text    ' variable SIPPNumber as input by the user in text box SIPPNo
End Sub

I have tried the following

Public Nextbutton_Click
MemberDataInputForm.SIPPNOData.Text = Me.SIPPNo.Text
End Sub

Also I have tried
 SIPPNoData.Text = Forms!USPcalculation!SIPPNumber

Whatevever I try I cannot get VBA to do what I want which is to put a copy of SIPPNo  Text box (prefilled with the user input from teh previous form) from form USPcalculation into the next form MemberDataInput Form.  

Variables are declared separately and publicly in the module.
Any suggestions please?
Question by:PetesPlace

    Author Comment

    I think I may have mistyped some of the variables above eg . in the wrong place capitals misplaced. That isnt the answer to the problem.
    LVL 8

    Accepted Solution

    First initialize the textBox value in Next form and then Show it.
    So change your code like follow :

    Public Nextbutton_Click
    MemberDataInputForm.SIPPNOData.Text = Me.SIPPNo.Text
    End Sub

    Author Closing Comment

    Thanks thats cracked it: easy when you know whow I guess.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    754 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

    20 Experts available now in Live!

    Get 1:1 Help Now