Solved

Can't access records in ADP

Posted on 2004-08-16
9
453 Views
Last Modified: 2013-12-05
Hi all,
    I have attempted to transfer my MDB into an ADP running on SQL Server. In the process, I managed to get all the data working after a while but my forms are not working properly. I have a form that contains multiple subforms. Form A (my primary form) has subforms (Form B, C, etc.). The table for Form A is Table A. For Form B, it is Table B, and so on. The tables are connected by a 1-to-1 or a 1-to-many relationship. They all reference Table A's primary key for the relationship.
    I am holding information of people in these tables, so Table A has their personal information such as address, etc. Table B has property they own, etc. Table C may have answers from a survey they have filled out. However, a person in Table A may not have a record in Table B because they do not have any property. Additionally, they may not have filled out a survey, so they do not have a record in Table C.
    Now my problem presents itself. All the relationships are set up nicely, etc. If you open up the form and scroll through the records, they all have the correct information in the subform. However, if you come to a record without any record for Table B or C, you get an empty subform. You cannot create a new record either. All the recordset navigation buttons are greyed out. However, on some of the subforms you can see the subforms and the navigation buttons are not greyed out. Can someone please tell me why? I know that in Access, the next record is "created" for you if you have no information and SQL Server does not do that. Is this the problem? How do I solve it? Thanks so much guys.
                   Sincerely,
                         JL
0
Comment
Question by:jl_forum
9 Comments
 
LVL 36

Expert Comment

by:SidFishes
ID: 11816987
after upsizing you must make sure every table has a primary key defined...this is usually the cause of not being able to add records

have a look at your tables and define one if it doesn't exist.
0
 

Author Comment

by:jl_forum
ID: 11823589
Hi Sid,
    I did do that and it seems as if problems seem to exist regardless of whether a key is there. This problem really only occurs on two subforms. I don't quite understand why. One of these subforms only shows the contents of the subform if they have a record. The other subform doesn't show anything regardless if they have a record or not. Any ideas?
            Sincerely,
                  Jon
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 11832306
Can you open the subform in regular form view (as opposed to opening it as a subform in the main form) and see records?  Have you tried to rebuild the form?  Do you use any third-party controls, or graphics controls?
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 11832427
had a thought...do you have your pk's set up to be an INT with autoincrement enabled?...or are you creating them with code

this might make a difference?...
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 44

Expert Comment

by:GRayL
ID: 11835687
Try: Properties of SubForm - Data Tab - Enabled: Yes, Locked: No
0
 

Author Comment

by:jl_forum
ID: 11836805
Hi guys,
   Thanks for all the comments! I tried opening the subform in regular view and its okay. I didn't rebuild the form but then again, I don't think its a problem with the form. No third-party controls are involved. This is a simple Access-driven subform (well... at least this part of it is). The primary keys are created automatically. No code is involved here. The pk's used to be autonumbering (random because of synchronization), but since it is now SQL Server, it autoincrements as far as I know. As for the subform tab data, it is enabled and everything seems good to go.
    One thing that I failed to mention that is may be of some use. When I open the main form, I get the error "Syntax error or access violation". However, the form opens up afterwards. Functionality-wise, there doesn't seem to be too much of a difference. It functions like it did before with the exceptions of the problem I said. Looking at routinet's comment, I tried to place an additional subform on the main subform (with the problem subform being the control source). I got the same blankness, however, I also got this error upon trying to just add a subform to the form: "Your code contains a syntax error, or a Microsoft Access function you need isn't available". I assumed this is the same error it is referring to when I try to open the form. Now, when I open the form, I get the "Syntax error or access violation" and I also get "Line 1: Incorrect syntax near ';'.". The subform does not have any VBA code either... what gives?? Please help!!
                 Sincerely,
                         JL
0
 

Author Comment

by:jl_forum
ID: 11837039
Hey guys, I found something. I changed the control source of that subform to something else and I seemed to fix it. Before it was a query to fill in a label while opening it. I think that solved it, as I can see it now... as for the other subform... I can see it but no records show up still.... Thanks for your help!
              JL
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12665034
Closed, 125 points refunded.

modulo
Community Support Moderator
Experts Exchange
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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

760 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

24 Experts available now in Live!

Get 1:1 Help Now