I have frmCalendar form that opens when I click a picture on frmMembers. I pass the name of the form that opened the frmCalendars form to a textbox on frmCalendars. Now what I'm wanting to do is when I select a certain date it puts the name of the text from txtFormName into a variable and then I can put the date selected into a field in the form that opened the Calendar. This is the code I have now.
When I try this, it says it can't find the form named stDocName. I tried this just to make sure it was getting the right info: MsgBox stDocName - It showed frmMembers, so it is getting the right info. If you have any ideas let me know.
Eric
Code:
Private Sub frmCal_Click()
Dim stDocName As String
stDocName = Me.txtFormName 'holds the form name that opened calendar
Forms!stDocName!DOB = [frmCal].Value
DoCmd.Close acForm, "frmCalendar"
End Sub
When I try this, it says it can't find the form named stDocName. I tried this just to make sure it was getting the right info: MsgBox stDocName - It showed frmMembers, so it is getting the right info. If you have any ideas let me know.
Eric