Mystery parameter on form open

steveg242

Registered User.
Local time
Today, 17:36
Joined
Jun 12, 2008
Messages
49
I'm having an issue and it's probably something stupid but it's really nagging at me so here it goes..

I have recently made some small changes to a form called Form2 (I'm simplifying he name for display purposes). On my main switchboard, I have a button to open Form1. When doing so I am suddenly getting a parameter box for Forms!Form2!ID. Yes, I have a control on Form2 called ID but I did before these changes.

I combed through the code in Form2 but I don't see a reason that parameter box is popping up. I should also mention, a group of end users use Form1 and others use Form2...there'd be no reason to have them both open.

I tried commenting out code in Form2 but in testing I noticed the fact that I had it open, either in view or design mode, got rid of the parameter box. So as a temporary solution, in my button, I preceded the open statement by opening Form2 and setting .Visible=False.

But that's a crappy solution. I'm still stumped as to the cause. I hope that's enough to go on without having to attach my database. Any suggestions?
 
Last edited:
Check the rowsources of lists and combos on your form. Those controls draw their display data from tables/queries, and therefore they execute SQL before the form opens. Maybe you have criteria in those SQL statements that tries to use that Form2 reference.
 
Yes, thanks, that might be it. These forms do have sub forms. For some reason, the control source was changed. I fixed it but now the sub forms don't work at all. I have to find an old backup to find out how it was set before. But I -think- I am on the right track.

I knew it was something stupid. :D

Though, having said that, I've had these sub forms for years and never had a problem like this.

Anyways, thanks. I am off to figure it out.
 
Ok, solved! Yes, it was the subforms. They were all messed up. A record source and control sources must have been inadvertently saved during testing, though I never touched those.

Ah well, mystery solved anyway. Thanks for pointing me in the right direction.
 
You bet. All the best with your project. :)
 

Users who are viewing this thread

Back
Top Bottom