Link to home
Start Free TrialLog in
Avatar of pele4483
pele4483

asked on

linked forms not working in access 2000

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!
Avatar of stevbe
stevbe

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
Avatar of pele4483

ASKER

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.
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 ?
yes
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.

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.
ASKER CERTIFIED SOLUTION
Avatar of svenkarlsen
svenkarlsen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.