• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 477
  • Last Modified:

Can't access records in ADP

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
jl_forum
Asked:
jl_forum
1 Solution
 
SidFishesCommented:
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
 
jl_forumAuthor Commented:
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
 
Steve BinkCommented:
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
SidFishesCommented:
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
 
GRayLCommented:
Try: Properties of SubForm - Data Tab - Enabled: Yes, Locked: No
0
 
jl_forumAuthor Commented:
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
 
jl_forumAuthor Commented:
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
 
moduloCommented:
Closed, 125 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now