RichardBott
MIS
I have some code in a Form_Activate() subroutine whose purpose is to display some values on the form that are from another (the parent called from) Form.
The code snippet is:
Private Sub Form_Activate()
Me.txtProgram_Name = Form_frmProjects.txtProgram_Name
Me.txtProgram_ID = Form_frmProjects.txtProgram_ID
Me.txtProject_Name = Form_frmProjects.txtName
Me.txtProject_ID = Form_frmProjects.txtProject_ID
...etc..
The first 2 assignments work fine. The third - assigning to Me.txtProject_Name - brings up an error "Can't assign a value to this object'. Each of assignee references are the 'Name' of text boxes on my form. Each of them have the 'Enabled' and 'Locked" propety set to 'Yes'. The assign from references are text boxes on the parent form.
The 4th assignment generates a rather long error message saying in part that 'The current field must match the join key '?' in the table that serves as the 'one' side of the one-to-many relationship....'
Is what I am attemptinhg to do a reasonable way of displaying on the child form values from the parent?
Can anyone explain why I am getting these error messages?
I have a relationship defined for the relationship between the parent and the child tables.
I open the form for the child table from a button on the parent table's form with the following code snippet:
strDocName = 'frmProjectAnnouncements"
strLinkCriteria = "Project_ID_long =" & Me!Project_ID_long
DoCmd.OpenForm strDocName, , ,strLinkCriteria
Any help would be greatly appreciated...
Richard.
The code snippet is:
Private Sub Form_Activate()
Me.txtProgram_Name = Form_frmProjects.txtProgram_Name
Me.txtProgram_ID = Form_frmProjects.txtProgram_ID
Me.txtProject_Name = Form_frmProjects.txtName
Me.txtProject_ID = Form_frmProjects.txtProject_ID
...etc..
The first 2 assignments work fine. The third - assigning to Me.txtProject_Name - brings up an error "Can't assign a value to this object'. Each of assignee references are the 'Name' of text boxes on my form. Each of them have the 'Enabled' and 'Locked" propety set to 'Yes'. The assign from references are text boxes on the parent form.
The 4th assignment generates a rather long error message saying in part that 'The current field must match the join key '?' in the table that serves as the 'one' side of the one-to-many relationship....'
Is what I am attemptinhg to do a reasonable way of displaying on the child form values from the parent?
Can anyone explain why I am getting these error messages?
I have a relationship defined for the relationship between the parent and the child tables.
I open the form for the child table from a button on the parent table's form with the following code snippet:
strDocName = 'frmProjectAnnouncements"
strLinkCriteria = "Project_ID_long =" & Me!Project_ID_long
DoCmd.OpenForm strDocName, , ,strLinkCriteria
Any help would be greatly appreciated...
Richard.