Solved

linked forms not working in access 2000

Posted on 2003-10-31
8
637 Views
Last Modified: 2007-12-19
i used the form wizard to make a linked form but it won't allow me to enter any data in a new record. tells me i can't add or change a record because a related record is required.  if i enter the data into the tables directly and then call up my form then everything is ok.  the funny thing is i made other linked forms in the past but i don;t remeber what i did to make it work. i knoiw i wrote some vb code for child and parent but i am missing something obvious or is there something i have to change in the form properties?

Please help- its sad when you can't remember!
0
Comment
Question by:pele4483
  • 4
  • 3
8 Comments
 
LVL 39

Expert Comment

by:stevbe
ID: 9657774
are the link child and link master properties set ?
are the fields you are using to link present in the record source for each form?

Steve
0
 

Author Comment

by:pele4483
ID: 9658132
this is not a subform where master and child properties are available.  there is a command button that needs to be pushed that opens the linked form.  i made two simple tables and set up a one to many relationship between the two and used the form wizrd with linked forms set to test out the code, it only took a few minutes and you will see that when you click on the button to open the linked form and you click on any of the fields(controls) the error pops up.  Someone on the google groups said that when you use the form wizard you won;t be able to edit new records and that is excatly what is happening, but i know there is a fix but i just can't remember it.
0
 
LVL 9

Expert Comment

by:svenkarlsen
ID: 9660851
OK, - lets see if I have got this right:

You have FormA, in which you view data from TableA

When you clcik a button, a new form (FormB) should pop-up with selected data from TableB, related to currently selected record in FormA

Is this what you need ?
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:pele4483
ID: 9661711
yes
0
 
LVL 9

Expert Comment

by:svenkarlsen
ID: 9662628
Fine,

Then:
 
 - make FormA based on TableA (no query reuired! - just make the form show the data of the table).
 
 - make FormB based on TableB (same as above)

 - in FormA, use the Button-Wizard to insert a button and choose the OpenForm track.


 - - - that should be it.

0
 

Author Comment

by:pele4483
ID: 9663473
i know there was more to it then that. there are visual basic routines for the child form and parent form in case the parent gets closed or the record of then main form gets changed so that the second form can also change automatically.
0
 
LVL 9

Accepted Solution

by:
svenkarlsen earned 50 total points
ID: 9663653
...... in case parent form gets closed:
    - you control that by making 'child-form' pop-up & modal, - then you can only work on child untill close

... in case the parent gets changed:
    - now you're more towards 'sub-form'-style, - everything is possible, but it's like any software project: you need
      to define what you require.

If you need to have some change in FormA be reflected in FormB, you have a selection of options: you may put the code in OnChange, OnUpdate and it may be put in the form events or the events of some control.

See: my problem is, that what you can't remember, I've never seen ;-)

I would be glad to help, but that would require that you specify what you need....
0
 

Author Comment

by:pele4483
ID: 9670190
i found the problem - my table in the one of a one-too many relationship had the linked field set to a default of 0 instead of null so everytime i called up the main form it would give me the error that i couldn't add or changed a record because that field did  exist even though i didn't manually ebter anything in yet.

Thanks foir your time anyways.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

776 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