Subform - requery

sonmic
sonmic used Ask the Experts™
on
Hi,

I have  a form with a subform. In the form i have 2 comboboxes. One for the article (called artikelnr) and one for the action that is needed (called meting).
When i select an article and then a meting the subform will not set up-to-date.
What i'am doing wrong?

Tx
On Error GoTo Err_Fout
    Dim rs As DAO.Recordset, db As Database
    Dim i As Integer
    Set db = CurrentDb()
    Set rs = OpenSeek("metingStandaardArtikel")
    With rs
        .Index = "Primarykey"
        .Seek "=", CLng(Forms!MetingItemsArtikel!Artikelnr), Forms!MetingItemsArtikel!Meting
        If .NoMatch Then
            .AddNew
            !Artikelnr = CLng(Forms!MetingItemsArtikel!Artikelnr)
            !Meting = Forms!MetingItemsArtikel!Meting
            .Update
        End If
    End With
    Me.Refresh
    Me.Requery
    Forms!MetingItemsArtikel.Form!MetingItemsArtikelSub.Requery

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hamed NasrRetired IT Professional

Commented:
Check Link Master/Child FIelds, in properties of subform control.

Author

Commented:
They are correct.
When i fill in the first meeting, the subform stays empty. When i fill in the second one (afterupdte) then he let see the two metingen.
When i select an artikel with existing meetingen then everything is correct. It's only when i add metingen when it go's wrong.
Hamed NasrRetired IT Professional

Commented:
Try to upload a simple database that shows the problem.
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Author

Commented:
Hi,

I had made, as you asked a small DB, an extract of the original because this is a big one. Strange but true, in this small DB the code works fine. The result is what i expect. Now i know where to search, but it is not solved yet. When i find it, do i have to set it in a comment?
Tx for your help.
Hamed NasrRetired IT Professional

Commented:
1 Yes, post a comment and select it as the answer.
2 You may ask for this question to be deleted, stating that you found your solution.

Author

Commented:
Hi hnasr,

I have a serious problem. This DB works on a network (Remote Desktop). When i select one item, nothing happens in the subform. When i select a second items, then the fist item will be displayed. When i do this operation with a breakpoint, and do every operation with F8, then the item is showed immediately. If i do the operation local then everything works like it should be.
Retired IT Professional
Commented:
Can't think of a reason without trying it. It might be a network related issue.
If you can supply a split database, frontend and backend, this might help.

Include only the necessary objects with dummy data.

Author

Commented:
I can't give a copy of the DB because it is not my property!
Hamed NasrRetired IT Professional

Commented:
For future questions, a sample database is a working demo.
Instead of real name, you include name1, ...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial