jbfraleigh
Registered User.
- Local time
- Today, 23:12
- Joined
- Aug 8, 2000
- Messages
- 22
I have a form (HappyForm) which opens up another form (VeryHappyForm):
DoCmd.OpenForm VeryHappyForm
Before closing, VeryHappyForm updates some controls on HappyForm:
[Forms]![HappyForm]![HappyControl] = [Forms]![VeryHappyForm]![VeryHappyControl]
Everything works and everyone is happy.
I now want to update the current record on a subform of HappyForm (Let's call it NotSoHappySubform) using data from a control on HappyForm - This is to be done from within VeryHappyForm just before I return control to HappyForm
Code:
Dim rst As DAO.Recordset
Dim strSQL As String
Set rst = Forms![HappyForm]![NotSoHappySubform].Form.RecordsetClone
rst.FindFirst "[FunData] = '" & Forms![HappyForm]![MoreFunData] & "'"
Forms![HappyForm]![NotSoHappySubform].Form.Bookmark = rst.Bookmark
rst.Close
Set rst = Nothing
DoCmd.Close
Here's the odd behavior: If I run this, HappyForm dissapears when this code is executed. If I debug and step through OR make a call to MsgBox somewhere within this code, it works perfectly.
I've tried playing around with [Forms]![HappyForm].Form.Visible ... Access wasn't to, um, happy.
So.. If anyone has any ideas, I'd gladly appreciate them!
Thanks!
DoCmd.OpenForm VeryHappyForm
Before closing, VeryHappyForm updates some controls on HappyForm:
[Forms]![HappyForm]![HappyControl] = [Forms]![VeryHappyForm]![VeryHappyControl]
Everything works and everyone is happy.
I now want to update the current record on a subform of HappyForm (Let's call it NotSoHappySubform) using data from a control on HappyForm - This is to be done from within VeryHappyForm just before I return control to HappyForm
Code:
Dim rst As DAO.Recordset
Dim strSQL As String
Set rst = Forms![HappyForm]![NotSoHappySubform].Form.RecordsetClone
rst.FindFirst "[FunData] = '" & Forms![HappyForm]![MoreFunData] & "'"
Forms![HappyForm]![NotSoHappySubform].Form.Bookmark = rst.Bookmark
rst.Close
Set rst = Nothing
DoCmd.Close
Here's the odd behavior: If I run this, HappyForm dissapears when this code is executed. If I debug and step through OR make a call to MsgBox somewhere within this code, it works perfectly.
I've tried playing around with [Forms]![HappyForm].Form.Visible ... Access wasn't to, um, happy.
So.. If anyone has any ideas, I'd gladly appreciate them!
Thanks!