G
Guest
If I already have a frmA and frmB open, how do I sent the value of
cmbComboBox on frmA to a txtTextBox on frmB and also have the cmbComboBox on
frmA behave as though the Enter key was pressed after the value is set.
If frmA is not open, the following code works (Provided the combo box is the
first control):
MyValue = Forms!frmB!txtTextBox.Value
DoCmd.OpenForm "frmA", acNormal
SendKeys MyValue & "{ENTER}", True
But if frmA is already open I cannot seem to get the sendkeys command to
send the data from frmB to the cmbComboBox on frmA even if I set the focus.
Here is the code:
MyValue = Forms!frmB!txtTextBox.Value
Forms!frmA!cmbComboBox.SetFocus
SendKeys MyValue & "{ENTER}", True
I am using the SendKeys command because I have code behind the cmbBox that
causes the frmA to search for a specific order number so I can just say
Forms!frmA!cmbComboBox = MyValue.
cmbComboBox on frmA to a txtTextBox on frmB and also have the cmbComboBox on
frmA behave as though the Enter key was pressed after the value is set.
If frmA is not open, the following code works (Provided the combo box is the
first control):
MyValue = Forms!frmB!txtTextBox.Value
DoCmd.OpenForm "frmA", acNormal
SendKeys MyValue & "{ENTER}", True
But if frmA is already open I cannot seem to get the sendkeys command to
send the data from frmB to the cmbComboBox on frmA even if I set the focus.
Here is the code:
MyValue = Forms!frmB!txtTextBox.Value
Forms!frmA!cmbComboBox.SetFocus
SendKeys MyValue & "{ENTER}", True
I am using the SendKeys command because I have code behind the cmbBox that
causes the frmA to search for a specific order number so I can just say
Forms!frmA!cmbComboBox = MyValue.