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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Filtering

Status
Not open for further replies.

access8

Programmer
Jun 21, 2002
27
US
Hello

I have a small problem. I have three Access forms one is the main form(frmAgreements) which has two command buttons. Each command button opens a form which is linked by the field AgreementNo. One of the forms (frmTasks) works great when the button is clicked it only displays the records pertaining to the Agreement No selected. The second form (frmInvoices) however does something quite funky. The second form has a subform. When I am in the main form (frmAgreements)and I click the button to go to the second form(frmInvoices) it does filter the records correctly on both the frmInvoices and subform, but I want the main field of the subform which is the InvoiceNo to display automatically. I went to design/view of the subform then I went to default view and put [Forms]![frmInvoices]![InvoiceNo] and then when I go back to the Invoice Form it tells me it cannot perform action at this time. Then it freezes the whole db. Any suggestions? Thanks you
 
I'm sorry but I do not undertstand. I write the code in the default value of the InvoiceNo field but it gives me an error saying that it cannot find the macro. Does this go in the On Current event???
 
Ok now I am getting the #Name? message....let me try something with this and post back...:D
 
Nope what I did, did not make too much of a difference it is giving me a #Name? error. It's almost working in fact when I enter a new comment in the subform the #Name? error displays automatically. So in other words in this code it is not recognizing something.
 
Please post exactly what you have in the Default Value.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
I was at first putting the code u gave me which sort of worked it seems now that anything I do even if I use the original code which was Forms!InvoiceNo!frmInvoices in the default value of the InvoiceNo field in the subform it stil give me the #Name? error. I am not sure why. Any other suggestions? Do you think the database is corrupted or has some type of bug that is causing all these errors?
 
access8: See my profile for my email address and send me a sample database with the table structures and forms. Delete all the data out except for a few dummy records and send it on and I will figure out where we are. We have either not been communcating or something is seriously wrong here. I have this technique working here and it should work for you. I am sorry about the complexity of our getting this right. I have to take much of the credit for it not going smoothly as I took us down a path earlier that was completely in the wrong direction.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
I received your email and thank you for responding. I sent you several attachments so you can view the errors that I am receiving.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top