G
Guest
I have a subform, in this subform I have a list records. I created a command
button to set focus on record in list and then send a key value to mainform.
The value of the combo box on the main form does show the key value that I
sent from the subform but it seems not to recognize the value. If I click
onto the combo box on the main form and hit enter the record moves to the
next record in the list. If I change delete one character in the key value
and enter that same character and hit enter the value then displays properly.
It seems the combo box is not aware of the new key valuve that was sent to
even though it is displayed. Here is the code that I attached to the command
button on the subform to do this....
Private Sub Command16_Click()
Dim ctl As Control
Dim rs As Object
Forms![Form1].[Vt subform].Form![VRC_NumberLL].SetFocus
Forms![Form1]![Combo56] = Forms![Form1].[Vt subform].Form![VRC_NumberLL]
Set ctl = Forms!Form1!Combo56
DoCmd.GoToControl ctl.Name
Set rs = Me.Recordset.Clone
rs.FindFirst "[VRC_Number] = " & Str(Nz(Forms!Form1![Combo56], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
button to set focus on record in list and then send a key value to mainform.
The value of the combo box on the main form does show the key value that I
sent from the subform but it seems not to recognize the value. If I click
onto the combo box on the main form and hit enter the record moves to the
next record in the list. If I change delete one character in the key value
and enter that same character and hit enter the value then displays properly.
It seems the combo box is not aware of the new key valuve that was sent to
even though it is displayed. Here is the code that I attached to the command
button on the subform to do this....
Private Sub Command16_Click()
Dim ctl As Control
Dim rs As Object
Forms![Form1].[Vt subform].Form![VRC_NumberLL].SetFocus
Forms![Form1]![Combo56] = Forms![Form1].[Vt subform].Form![VRC_NumberLL]
Set ctl = Forms!Form1!Combo56
DoCmd.GoToControl ctl.Name
Set rs = Me.Recordset.Clone
rs.FindFirst "[VRC_Number] = " & Str(Nz(Forms!Form1![Combo56], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub