RobbieC
Active Member
- Joined
- Dec 14, 2016
- Messages
- 376
- Office Version
- 2010
- Platform
- Windows
Hi there, I have a userform which launches another userform (calendar). It passes a variable to the 2nd form to identify the 'formFrom'
when the user selects the required 'date', I need to pass this value back to my original form "Form1". I can hardcode using:
but I need to re-use this form in multiple places. I thought I could use my formFrom caption to send it back to the correct form:
but obviously, this is not the correct syntax, just to demonstrate what I'm trying to achieve...
If you can point me in the correct direction, I'd be very grateful. Thanks
Code:
calendarForm.formFrom.caption = "Form1"
calendarForm.Show
when the user selects the required 'date', I need to pass this value back to my original form "Form1". I can hardcode using:
Code:
Form1.DateInput.Caption = Format(todaysDate, "dd/mm/yyyy")
Unload Me
but I need to re-use this form in multiple places. I thought I could use my formFrom caption to send it back to the correct form:
Code:
dim formFromVar as string
formFromVar = Me.formFrom.caption
[COLOR=#ff0000]formFromVar[/COLOR].DateInput.Caption = Format(todaysDate, "dd/mm/yyyy")
Unload Me
but obviously, this is not the correct syntax, just to demonstrate what I'm trying to achieve...
If you can point me in the correct direction, I'd be very grateful. Thanks