Solved

Access subform not working for data entry after upsizing backend

Posted on 2014-11-19
7
328 Views
Last Modified: 2014-11-20
I am working on a project where I am upsizing an access database to Sql Server. I had very little trouble converting the tables. The application keeps track of requisitions and has a form for entering header information, and a subform that contains information about the line items. Everything works great when viewing existing data. However, when entering a new requisition, the subform does not work when entering information about the line items. It seems like it is not even there. I have tried changing the properties of the form and the subform, examining the related fields, and recreating the forms. It must be something related to the change to SQL server, as it works fine in access.
0
Comment
Question by:tmalmond
  • 3
  • 2
  • 2
7 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 40453736
>The application keeps track of requisitions and has a form for entering header information, and a subform that contains information about the line items
>when entering a new requisition, the subform does not work when entering information about the line items.

I'd start by performing step-through debugging on the Requisitions form, specifically the code that executes when header information is entered that results in creating row(s) in the line items table.

Chance are there's an 'On Error Resume Next' that is masking any errors from being displayed to the user.
Also there's a change that the line items table had an AutoNumber field somewhere, where the SQL Server equivalent is Identity(), and it wasn't created correctly, forcing the error.

Good luck.
Jim
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 40453859
Also, make sure that the tables associated with the main form all have primary keys in the SQL Server database.  I always add a field with a TimeStamp (misnomer) datatype to the tables once they are in SQL Server as well.  This field is not viewable in Access, but helps identify write conflicts when multiple users are attempting to edit the same record.

I assume you are using linked SQL Server tables?  If so, make sure you refresh the links after making the appropriate changes to the SQL Server data structures.
0
 

Author Closing Comment

by:tmalmond
ID: 40453925
That was the problem. The line item table had no primary key. As soon as I created the key and refreshed the links, it started working properly. I also created a foreign key for the linking field in the header table. I don't know if it is necessary, but it seemed like a good idea while I was creating .
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40453941
Yes, having a FK in the child table is essential, don't know how you had it working in the original "all Access" version without that.
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 40454022
The upsizing must not have created any table relationships either..
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40454057
Out of interest, how did you perform your "upsizing"?  Did you use the Access Upsizing Wizard, or did you use the SQL Server Migration Assistant?
0
 

Author Comment

by:tmalmond
ID: 40455781
To answer Dale's question, The original access version had table relationships. I tried using both of those methods, upsizing wizard and migration assistant. Since the original version was access97, neither would work properly. I imported the tables via excel. The largest table only had 3900 records, so it wasn't a problem. This was a simple exercise in preparation for a more rigorous one! Now that I know some of the things to look for, I am hoping that the next stages go well. My thanks to everyone who contributed.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now