Results 1 to 3 of 3
  1. #1
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    SQL Server Data won't show up in subform - Repost



    *** Reposting due to lack of response. It may be because I replied to my own comment, not sure. ***
    Part 1

    We just migrated some tables from an local Access database to a SQL Server back end. The tables have the exact same structure and data as the original. The form is a continuous form that reads the data in this table (the other one is a look up table) stored by patient number and admit date. Using the Access table the form works as designed, looking up codes and descriptions in lkDiagnosisCode_ICD10 and storing them in tblDiagnosis_ICD10. When I switch tblDiagnosis_ICD10 to the copy on the SQL Server, the form vanishes. I get a blank white square where the subform is supposed to be. The combo boxes that do the lookups are able to read SQL Server version of lkDiagnosisCode_ICD10 identically to the Access table.

    With Access table
    Click image for larger version. 

Name:	subform Access.JPG 
Views:	12 
Size:	94.2 KB 
ID:	25364

    With Sql Server table
    Click image for larger version. 

Name:	subform ss.JPG 
Views:	12 
Size:	28.1 KB 
ID:	25365


    Only the SQL Server version of tblDiagnosis_ICD10 causes this problem. I've opened both these tables in table view and I can read and edit the data in both versions. As far as I can tell they are identical. My thoughts were that this would be a seamless transition. What am I missing?

    Part 2.

    Here's a critical piece I left out. I copied my form and switched back and forth between the two tables, SQL Server and Access versions. When I open the form using the SQL version I get this error.


    I do not know enough about SQL Server to diagnose this. Can you give me something I can take to our DBA?

    Part 3
    Just added a Primary Key to the Sql Server table. Results are the same. The subform does not appear when referencing the SS table. Works just fine with the Access table.

    I expected switching tables to be easy, but this has stopped me dead in my tracks. Any help will be appreciated.

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Seems like a datatype issue between your search field and the SQL field. Post the key Fields in SQL and Access tables and their Datatypes from each.

    Test a few things:

    1. On the form, take out the Search criteria and see if the form shows with all records from SQL.
    2. Create a new Form based on some fields from the SQL table. If it works, create a lookup fields and see if it works.

  3. #3
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I tried copying the form, editing and deleting combo boxes all the way to deleting everything on the form with no results. I found this puzzling and finally decided to rebuild this form from the bottom up. I created a blank form, hooked to my SQL Server table, then viewed it in form view. Step by step I copied all the controls into the new form and displayed the results in form view. Finally I copied all my code from the original form into the new form module. So far, so good. I changed the form to a Continuous form, success. Finally I put the new form in the subform of my master form and wa la! It worked. Right now I am back in business. I am attributing all this to some Access bug. I am still suspicious and a little worried of this problem reappearing. I fail to see how the source (SQL Server) of the table would cause this to happen to my form, but who am I to look a gift horse in the mouth. I'll leave this open for now, but at least I can go home today with a clear conscience.

    Thanks to the forum owners for letting me work out my problems in public. Sometimes that is the only way.

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

Similar Threads

  1. SQL Server Data won't show up in subform
    By Paul H in forum Forms
    Replies: 4
    Last Post: 08-08-2016, 01:15 PM
  2. Replies: 5
    Last Post: 05-17-2013, 10:45 AM
  3. Replies: 7
    Last Post: 11-13-2012, 01:44 PM
  4. Replies: 8
    Last Post: 11-08-2011, 05:11 AM
  5. Subform will not show data
    By Brian62 in forum Forms
    Replies: 2
    Last Post: 02-19-2010, 10:43 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