C
Christine
Hope someone can help me with this little problem, quickly
if possible!
Could someone advise how to set the control source for an
unbound control on a form from another form?
For example, if the user clicks CmdDescription in FormA,
FormB will display the Description for that record. In the
same FormA, if they click CmdSolution, FormB will display
the Solution field, etc.
In essence, what I'm doing is trying to replicate the
Access Zoombox command. (Can't use the built-in Access
Zoombox feature in this instance.)
Here's what I've got thus far in Form A. The unbound
control in FormB that I want to set the Data Control
Source for is named "VaryRecSource". The same table is
used in each form. The field in FormA can be edited, as
well as the field in FormB.
DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String
Dim stLinkCriteria As String
Dim VaryField As String
stDocName = "FormB"
VaryField = "Description"
stLinkCriteria = "[CARNum]=" & Me![CARNum]
DoCmd.OpenForm stDocName, , , stLinkCriteria
In FormB, the name of the control is "ThisField" and the
control source is =[VaryField]. (Public VaryField is
declared.) The problem appears to be getting the current
value of VaryField from the table, since FormB will be
called from a variety of forms other than FormA.
Any help ASAP will be greatly appreciated.
Christine
if possible!
Could someone advise how to set the control source for an
unbound control on a form from another form?
For example, if the user clicks CmdDescription in FormA,
FormB will display the Description for that record. In the
same FormA, if they click CmdSolution, FormB will display
the Solution field, etc.
In essence, what I'm doing is trying to replicate the
Access Zoombox command. (Can't use the built-in Access
Zoombox feature in this instance.)
Here's what I've got thus far in Form A. The unbound
control in FormB that I want to set the Data Control
Source for is named "VaryRecSource". The same table is
used in each form. The field in FormA can be edited, as
well as the field in FormB.
DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String
Dim stLinkCriteria As String
Dim VaryField As String
stDocName = "FormB"
VaryField = "Description"
stLinkCriteria = "[CARNum]=" & Me![CARNum]
DoCmd.OpenForm stDocName, , , stLinkCriteria
In FormB, the name of the control is "ThisField" and the
control source is =[VaryField]. (Public VaryField is
declared.) The problem appears to be getting the current
value of VaryField from the table, since FormB will be
called from a variety of forms other than FormA.
Any help ASAP will be greatly appreciated.
Christine