Linking a field from one form to a subform of another form

F

FA

I am having a problem in linking a form (Sys_Form) to a
subform(Finding_Form) which is a subform of a form(STD_FINDG). Sys_Form
is based on one table SYS_INFO with a PK (SYS_ID_CODE). Finding_Form is
based on one table FINDG with a PK (Finding_No) and FK (SYS_ID_CODE).
Form STD_FINDG does not have any relationship with SYS_INFO since its a
default data for Finding_Form.
I want to be able to have a command botton on Sys_form that can take
the user to STD_FINDG form and populate the SYS_ID_CODE in the subform
(Finding_Form).

I tried the Following
Dim stLinkCriteria As String, form1 As String, form2 As String
Dim form3 As String
form1 = "dbo_STD_FINDG"
form2 = "Findng_Form"
form3 = "sys_form"

stLinkCriteria = "[SYS_ID_CODE]"&Me![SYS_ID_CODE]
DoCmd.OpenForm form1,,,stLinkCriteria
form1!form2.Form![SYS_ID_CODE] = form3!.Form![SYS_ID_CODE]

Its giving me error message "Qualifier must be Collection"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top