7

I have a form in access with 5 nearly identical sub form . When I load the form it usually go fine. However, we recently changed from Access backend to SQL and since then , the form doesn't seem to load properly.

If I go to design mode and then to normal mode, everything loads fine. This, however, is not a viable option, the user can't do this.

Anyone had that problem or knows how to solve this ?

Edit Screenshot of the problem

1 : This is the first one , which worksl

enter image description here

2 : And this one does not.

enter image description here

3: Hoever, if I click on Design mode and then click on view mode againt, I see that it works, at least to some extant :

enter image description here

Thanks

David Brunelle
  • 6,528
  • 11
  • 64
  • 104
  • Please provide details on why it's not loading properly. – Rono Feb 08 '16 at 15:04
  • It's the problem, I have no clue why it's not loading. Like I said, when I go to desgign and go back to normal view, it loads. Plus the only thing that changed is the data source... – David Brunelle Feb 08 '16 at 19:49
  • I'm looking for what you're seeing. Perhaps a screen shot would help. – Rono Feb 08 '16 at 20:10
  • A few things I'd try are: 1. Run Compact/Repair Database 2. Delete the attached tables and reattach them. 3. Import everything into a new MDB. – Rono Feb 08 '16 at 20:56
  • 1
    Can you post each faulty subform's recordsource? Also, if the recordsource is sql, try each in a query object and see if that query runs ok. – Matt Hall Feb 09 '16 at 16:06

3 Answers3

1

I had this problem a long time ago with linked tables. Some kind of a connection problem. I think I fixed it by having my main Form open with its Subform pointing to a blank placeholder Form, and then via VBA (can't remember the Event) I replace the SubForm pointer with the name of the Form that was the real SubForm.

0

Please provide the record source of your subform. AFAIK this behavior can be the consequence of a timing problem. When you click on Design Mode and then back to View Mode, you have all record sources to SQL (main and sub-form) already defined and initialized: timing is no more a problem.

In the Form_Current event of the main form try to redefine the record source of your subform, Requery it with Me.SubFormControl.Form.Requery.

Cisco
  • 251
  • 1
  • 7
  • I fancy this is a timing problem, but I don't understand why it would be ok in access and not in sql, the same code is ran but with different results. – David Brunelle Feb 10 '16 at 12:38
0

There could be many issues.

  1. Your sub-form is already open.
  2. Your sub-form control is bound as master-child ans has no records to show.
  3. Your sub-form is bound as master-child and has passthrough query as datasource.

I think the culprit is the tabbed pane and a duplicate sub-form. Convert your tabbed pane to a navigation pane and reassign all sub-forms.

Remember, tabs will open all 5 sub-forms before loading the parent form where duplicate sub-forms will only be opened once (your problem)

On the other hand, Navigation pane will load each form on-demand (when you navigate to a button). Try this and let us know please.

Edit Also i don't quite understand why you would have 7 similar forms for each weekday! ideally you would have one form selecting which day it is? but again this is structural issue and has nothing to do with your question.

Krish
  • 5,917
  • 2
  • 14
  • 35