Solved

passing data from one userform to another

Posted on 2004-10-18
3
199 Views
Last Modified: 2008-03-06
Hi,

I have 2 userforms in an excel macro, in the first one there is a text field and button near it. when the button is pressed, a second userform opens. On the second userform, there is the calander control with an ok button. when a date is selected, and the ok butotn is pressed, I want the second userform to be dismissed, and the date entered into the text field on the first userform with the format dd/mm/yyyy - not including the hours and mins. or whatever goes by default. I also need to reference that date inside the macro in another function within the first userform.
can someone explain how variables are passed along in vba?

thanks in advance
0
Comment
Question by:cedop
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12339047
Just add module and create a public variable there


set the variable when your second form unload

ie

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)


d = "your date form string"
End Sub
0
 

Author Comment

by:cedop
ID: 12342309
where do i put this
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 125 total points
ID: 12346074
>>where do i put this

Just insert the module into your excel

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Put text in a picture ASP.NET C# 2 68
Recommendation vb6 to vb.net or others 14 207
Child Form in front 4 57
Copy a range from 1..n excel sheets to one destination sheet 2 66
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

733 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