Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Would like to have a pop-up form that is linked to my main form.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I currently have a subform in my main form. Since there is not always info entered into the subform when a new main record is created and space on my main form is limited, I would like to use a command button so the subform will pop up and allow the user to enter the info when necessary.

I have done it so the form will pop up with the proper child records but for some reason the words (filtered) show up next to the record numbers and I cannot enter in new stuff.
I have linked the two tables through the command button wizard by the main forms primary key and the corresponding field on the subforms (now pop-up form) table.

Any ideas?

Oh, I noticed that when I try to enter in a new record in my pop-up form, when I look at the existing records, they show the same primarykey# that my main form is. When I go to a new record, it shows zero , I'm guessing because the record does not exist so it choses zero by default.
 

I'm not sure what you mean by " the words (filtered) show up". The primary key for the sub/main record should match if you linked the forms. If your record is set from the main form then you cannot add a new record in the sub form. If you set a master/child relationship for the subform you should be fine. Your sub form should only reference a single record. You can launch the pop up with a macr that includes a setvalue statement for a unique field. ie. setvalue [custnum]=[yourmainform].[custnum]
 
I just re-read what I wrote and I didn't state what I meant properly.

I have two tables, one is for my main form and the other is for my subform (which is in the main form)

Instead of having a subform on my main form (which I currently have and it works fine), I would like to use a command button on my main form to open up a form that does the same kind of job as the subform did (Have child records that link to the parent record).

I tried to do this by linking the parent records unique key# to a field in the child record (which the child record uses as a reference to know which parent record it is associated to) so it seems to have the same kind of link that the subform did.

However, unlike the subform which allows me to view records that have already been entered and to enter new ones, the new form that opens up with the command button only allows me to view the old child records but not add any new ones.

The word (filtered) shows up just to the right of the record number on the record selector at the bottom of the form. When I advance to a new record on the child form, it no longer shows the unique key# but instead shows the number zero. This is obviously due to the fact that it cannot find anymore child records associated with the parent record.

I would like to get this form to work like the subform did but I haven't had much luck yet.

Hope this makes my problem a little clearer.
 
I'll take a shot at it and see if I can help. It sounds like when you click the command button to go to your newly built form it's finding (linking) to the correct record but if I understand right it will not add a new record with the correct ID#. Now if the above is true have you tried putting =Forms![FormName]![IDFieldName] in the Default property of your new form? As soon as you enter information into a new record it should assign the ID # from first form you opened. This works as long as the new form is still open.

Hope I understood right and this helped.
 
THANK YOU VERRRRRY MUCH! That was exactly what I needed. Thanks! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top