Solved

Access subform not working for data entry after upsizing backend

Posted on 2014-11-19
7
317 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

706 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