Full Version: Parent form
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
Grafixx01
Ok, so I kind of figured out how to get my date button to work so that it will put the selected dates into the txt.(name) boxes on the form. Well, at least I figured out the coding for it.

Now the problem I can't figure out is how to define a parent form? The form that would be the parent form is frmTaskLog

Anyone?
Aquadevel
Graf,

Can you provide a lil' more info on what you are trying to do ?
Even post the database <mnus any sensitive data> would help.

good luck, sad.gif

Aqua
dashiellx2000
Do you mean Refering to Forms/Subforms Properties and Controls?
Grafixx01
This is the issue. The command button is there and when you select the date and click "Insert Date" I want it to insert the selected date into a txtBox on a main form called, frmTaskLog.

Code:

Private Sub cmd_Insert_Date_Click()

Me.Visible = False 'changed
Forms(strParentForm).Controls(strTextBox).SetFocus 'changed
Forms(strParentForm).Controls(strTextBox).Text = CDate(calCalendar.Value) 'changed
DoCmd.Close acForm, Me.Name, acSaveNo 'changed

End Sub
R. Hicks
To reference a control in the parent (main) form from the subform .. use:

Me.Parent.YourControlName =

Where "YourControlName" is the actual name of the control being referenced in the parent form ...

RDH
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.