Results 1 to 6 of 6
  1. #1
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328

    SubForms not displaying data

    I am using a2007 and a2003 with a weird problem . Coding is with VBA.

    I have a query sourced form with two subforms that are sourced to a table. The subforms are linked to the parent by an IDquote number. When update is clicked, the program imports a list of items from an excel file (excel is in same folder as the program) with unit prices to a table in the server. That table is the source for the subforms. ( I use two subs to so that the user can see all items without scrolling). The code for the transfer includes a requery and refresh command.

    I have a weird problem. After an update, the subforms will show blank often, even though their source table is populated. If I create a copy with the tables and the program without a link, it runs fine.

    Is there something special I should be do because of the server link? Or, am I playing with a corruption? Any help much appreciated.

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,930
    after the update, do you requery the subforms?

  3. #3
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Yes. The last item in code is form.requery. After receiving your reply, I added Form.SubformName.requery and still get blanks. Something strange; I hit the F9 recalc key when showing blank, then data appears.

  4. #4
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,930
    I added Form.SubformName.requery
    try just SubformName.requery

  5. #5
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Works! Thanks much. I will never understand Access. It seems so inconsistent. This works fine without link, worked with link for long time. Now need this. Thanks again for solution and for quick replies. Much Much appreciated.

  6. #6
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,930
    not really

    you have the forms collection of all the open forms so to reference a form from outside of that form (e.g. another form, a query or report) you use forms!myformname

    in a form you have 'me' which is a collection of all the form properties, sections and controls - so me.requery requeries the whole form or me.controlname.requery requeries a specific control. Me is the default so does not normally need to be used, but some consider to be good practice to use it. Sections and controls are also collections so you could use me.controls.controlname.requery if you wanted to do all that typing

    subforms are slightly more complex - they are a control, so me.subformname, but they contain a form so to refer to a control on the subform from the main form is subformname.form.controlname. If you like think of subformname.form. being the way your refer to me. on a subform

    and from subform to refer to a control on the mainform you use parent - e.g. parent.controlname

    So just think about 'where you are' in relation to 'where is the data' and all should become clear!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple Subforms with Related Data
    By funkymuppet in forum Forms
    Replies: 1
    Last Post: 04-01-2014, 08:40 PM
  2. Subforms to enter data
    By novo in forum Forms
    Replies: 4
    Last Post: 03-01-2013, 02:15 PM
  3. Replies: 2
    Last Post: 01-02-2013, 02:43 PM
  4. Diplaying all row fields in Cross Table Query
    By khartoum in forum Queries
    Replies: 8
    Last Post: 05-30-2012, 03:13 AM
  5. Replies: 5
    Last Post: 01-18-2012, 12:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums