I have a form which references two tables.
The second table has a one-to-many relationship with the first table.
I have a button which is intended to copy the key value from the second table to the first.
This button works when the second table is arranged into the form as a subform, but I do not need to see the entire default subform.
I only need a small subset of the fields from the subform.
Attempts:
1) The button does not work if I hide the subform and add in linked text boxes. The text box as well does not link to the subform.
2) The button does not work if I simply add the desired fields at text boxes with the 'Add Existing Fields' tool from the design tab.
As I understand the problem now, it is an issue of getting my field reference(s) to work correctly in the button's VB code:
Example-1)
Private Sub Command34_Click ()
'INSERT CURRENT ARRAY ID.
Me.[ARRAY_ID_ARRAYS].SetFocus
DoCmd.GoToRecor d , , acLast
Me![ARRAY_ID] = Me.[ARRAY_ID_ARRAYS]
Me!NOTES.SetFoc us
End Sub
Example-2)
Private Sub Command34_Click ()
'INSERT CURRENT ARRAY ID.
Forms![CLEAN DATA]![ARRAY_ID_ARRAYS].SetFocus
DoCmd.GoToRecor d , , acLast
Me![ARRAY_ID] = Forms![CLEAN DATA]![ARRAY_ID_ARRAYS]
Me!NOTES.SetFoc us
End Sub
I am using MS ACCESS 2007 on Windows XP.
Motivation:
I am a deep SAS user, but building forms in SAS is too time consuming and often clients lack the software. Being able to push ACCESS onto SharePoint and websites looks 'easier' as well. So I am now learning 'yet another software'.
Thank you,
Hal
The second table has a one-to-many relationship with the first table.
I have a button which is intended to copy the key value from the second table to the first.
This button works when the second table is arranged into the form as a subform, but I do not need to see the entire default subform.
I only need a small subset of the fields from the subform.
Attempts:
1) The button does not work if I hide the subform and add in linked text boxes. The text box as well does not link to the subform.
2) The button does not work if I simply add the desired fields at text boxes with the 'Add Existing Fields' tool from the design tab.
As I understand the problem now, it is an issue of getting my field reference(s) to work correctly in the button's VB code:
Example-1)
Private Sub Command34_Click ()
'INSERT CURRENT ARRAY ID.
Me.[ARRAY_ID_ARRAYS].SetFocus
DoCmd.GoToRecor d , , acLast
Me![ARRAY_ID] = Me.[ARRAY_ID_ARRAYS]
Me!NOTES.SetFoc us
End Sub
Example-2)
Private Sub Command34_Click ()
'INSERT CURRENT ARRAY ID.
Forms![CLEAN DATA]![ARRAY_ID_ARRAYS].SetFocus
DoCmd.GoToRecor d , , acLast
Me![ARRAY_ID] = Forms![CLEAN DATA]![ARRAY_ID_ARRAYS]
Me!NOTES.SetFoc us
End Sub
I am using MS ACCESS 2007 on Windows XP.
Motivation:
I am a deep SAS user, but building forms in SAS is too time consuming and often clients lack the software. Being able to push ACCESS onto SharePoint and websites looks 'easier' as well. So I am now learning 'yet another software'.
Thank you,
Hal
Comment