Populate unbound Control

S

S Jackson

I have a form called fsubWitnesses based on the table tblCaseWitnesses

When you click a button on the fsubWitnesses form, it opens up a new form:
fsubWitnesses2
I have code that sets the link criteria
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fsubWitnesses2"
stLinkCriteria = "[DHSNo]=" & "'" & Me![DHSNo] & "'"
DoCmd.OpenForm (stDocName), , , stLinkCriteria

Now I want the code to populate an unbound text box on the fsubWitnesses2
form form. The text box is called "CaseName"
I want to populate the text box CaseName from the the first form's
(fsubWitnesses) Parent!CaseName

I know this has been answered here before on this form, but I can't find it!
Thanks in advance
S. Jackson
 
V

Van T. Dinh

Add the following codes:

DoEvents
Forms!fsubWitnesses2!CaseName = Me.CaseName

after your posted OpenForm statement.

I assumed they are 2 *separate* Forms and NOT Form/SubForm combination since
I am not sure from the naming convention you used.
 
S

S. Jackson

Thanks for your reply, I'll give it a try.

S. Jackson


Van T. Dinh said:
Add the following codes:

DoEvents
Forms!fsubWitnesses2!CaseName = Me.CaseName

after your posted OpenForm statement.

I assumed they are 2 *separate* Forms and NOT Form/SubForm combination since
I am not sure from the naming convention you used.

--
HTH
Van T. Dinh
MVP (Access)




S Jackson said:
I have a form called fsubWitnesses based on the table tblCaseWitnesses

When you click a button on the fsubWitnesses form, it opens up a new form:
fsubWitnesses2
I have code that sets the link criteria
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fsubWitnesses2"
stLinkCriteria = "[DHSNo]=" & "'" & Me![DHSNo] & "'"
DoCmd.OpenForm (stDocName), , , stLinkCriteria

Now I want the code to populate an unbound text box on the fsubWitnesses2
form form. The text box is called "CaseName"
I want to populate the text box CaseName from the the first form's
(fsubWitnesses) Parent!CaseName

I know this has been answered here before on this form, but I can't find it!
Thanks in advance
S. Jackson
 

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