By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,221 Members | 1,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,221 IT Pros & Developers. It's quick & easy.

Invisible forms

100+
P: 166
Hello:

I have a form (F_TestRpt) that needs to get it's information from an unbound value on another form (F_MixDesign). The issue is that the F_MixDesign form wouldn't be open when the F_TestRpt was open, so I was wondering if when the F_TestRpt was launched, if it would be possible to also launch the MixDesign form in the background as invisible?

Thanks
Jan 29 '09 #1
Share this Question
Share on Google+
6 Replies


Expert 100+
P: 1,287
You can use:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "My Form Name", acNormal, , , , acHidden
Jan 29 '09 #2

100+
P: 166
Hi Chip,

Should I use this in my onLoad or onCurrent Event?

If I should use it in my onCurrent event, should it be in a Private Sub()? or can I just add it? I ask because I already have some requeries in the event:

Private Sub Form_Current()
Me.cbojobNumber.Requery
Me.DM_Mix_cbo.Requery

Me!SF_MixBatch.Form.DM_MaterialNo
>>This part is not working though, I just wanted to Requery the control DM_MaterialNo on the SF_MixBatch Form when the main form is on the current record...I keep getting an error about it not being supported

Me.List71.Requery

End Sub
Jan 29 '09 #3

Expert 100+
P: 1,287
I'm a little confused. You said that the info you need on F_TestRpt is on F_MixDesign, which wouldn't normally be open. Where does F_MixDesign get the value for this control when you open it, and why can't you just do the same for a control on F_TestRpt?

Your code seems unrelated, but if SF_MixBatch is a subform and you want to requery a control on it, use:
Expand|Select|Wrap|Line Numbers
  1. Me!SF_MixBatch.Form!DM_MaterialNo.Requery
Jan 29 '09 #4

100+
P: 166
the extra code was unrelated to opening the MixDesign form, but I need certain things to be updated in the event as well, which is why all of the other code is there. That's why I was asking if I should have that code in it's own event since all of the other code was in the event.

F_MixDesign has the value for the control on it as a field...but what I just thought about is that when it's open it will always open to the first record so then that information will be xferred to the F_TestRpt, which would not be correct. But I guess since when my user opens the F_TestRpt form , he would navigate to what he was working on, which in turn would change the DM_Mix number, which in turn would update the F_MixDesign DM_Mix number??? Or would I have to add code to say as the DM_Mix on F_TestRpt changes, update to the correct DM_Mix in F_MixDesign?
Jan 29 '09 #5

Expert 100+
P: 1,287
I'm not clear on how you want your users to navigate or use your forms, but you have some options. One thing you can do in the F_MixDesign in Current(), or some AfterUpdate() is check whether the other form is open, and if it is, update or requery whatevery you need to:
Expand|Select|Wrap|Line Numbers
  1. If CurrentProject.AllForms("Other Form Name").IsLoaded Then
  2.             'call requery on some control on that form
  3. End If
Jan 29 '09 #6

100+
P: 166
Chip,

Here is what I have in my onCurrent event of the F_TestRpt:
Private Sub Form_Current()
Me.cbojobNumber.Requery
Me.DM_Mix_cbo.Requery
Me!SF_MixBatch.Form!DM_MaterialNo.Requery
Me.List71.Requery


'Open MixDesign in the background where DM_Mix = DM_Mix_cbo

DoCmd.OpenForm "F_MixDesign", View:=acNormal, _
WhereCondition:="DM_Mix = " & DM_Mix_cbo, _
WindowMode:=acHidden
End Sub

And it works! As I change records in the form, the DM_Mix updates in the invisible form as well so I don't have to worry about it would get updated.

Thanks for sharing your wisdom! :)
Jan 29 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.