• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

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

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.Show
MemberDataInputForm.SIPPNOData.Text = Me.SIPPNo.Text
End Sub

Also I have tried
MemberDataInputForm_Onload()
 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?
     
0
PetesPlace
Asked:
PetesPlace
  • 2
1 Solution
 
PetesPlaceAuthor Commented:
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.
0
 
VipulKadiaCommented:
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
MemberDataInputForm.Show
End Sub
0
 
PetesPlaceAuthor Commented:
Thanks thats cracked it: easy when you know whow I guess.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now