Question about subforms

page , subform , vba , tabcontrol Santa Clara, United States
  • 11 years ago

    I have a tab control with multiple subforms. My goal is to pass a current product ID from the main form into one of the subforms chosen by the user and have it display/populate all its fields based on the product ID when the event PID.GotFocus happens. I started with one subform and it worked. But then when I did another one, with almost identical code (simple DAO recordset query), this time when it's opened it doesn't do anything until I click on it then the data will display. If I don't click the subform only the PID is shown on it, that tells me the event PID.GotFocus did occur but the event handler didn't execute. Do you know why it behaves differently? Furthermore if I pass the PID by hand in the subform load event and run PID.SetFocus then the data will display automatically next time I open it. But it won't work since the PID must be passed from the main form.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Memory is like an orgasm. It's a lot better if you don't have to fake it.” - Seymour Cray