Wayne311,
Here's a link you may find useful: http://www.mvps.org/access/forms/frm0031.htm
That worked, I think. Thanks for the link.
Wayne
Adam,
I am not sure what you think was solved...not my question. RG told me how to attach just the tables and forms involved with what you requested instead of sending all my experimental musings!
Any thoughts on the problem with the expression?
Wayne
sorry about that! just looked at the end of the thread and thought it was.
I have to install a trial of 2010 on this netbook. I'll get back to you here shortly when I do that and see what you've got.
Wayne,
I didn't have time to figure out your relationships and such, but whatever process you're going through, this should work fine in the AFTERUPDATE event of your "District" textbox:go to the prop sheet for the textbox, click that event and paste that code on into the code windowCode:Private Sub District_AfterUpdate() Me.Text13 = DLookup("Charge", "Districts", "[District]=" & Me.District) End Sub
That gave me an error...see attached.
Wayne
Well Wayne,
take a look at the picture. Is that the way you want it to work??
alright Wayne. I dropped all the source, and gave you an example.
attached is it. put a number in the top left box and see the charge appear.
Regardless of whether a parent child relay is present, you would have eventually run into the fact that your ID field in the table is TEXT, not a number.
vba syntax is different for these two datatypes, and confusing to boot.
Adam,
That is interesting. I was trying for that in the text box below the one you used, but that works too. During all of this the field DISTRICT has been both text and a number. As it has no need to be calculated, I wasn't sure if it mattered.
Now I am puzzled as to why there are errors with every field of the form relating to table RCPTDATA. One problem solved...13 new ones created. Could this be due to the relationships and the junction table?
Thanks for the help
Wayne
Attached is a picture of all of the RCPTDATA errors. But it shows your fields work!
Wayne
No Wayne,Adam,
That is interesting. I was trying for that in the text box below the one you used, but that works too. During all of this the field DISTRICT has been both text and a number. As it has no need to be calculated, I wasn't sure if it mattered.
Now I am puzzled as to why there are errors with every field of the form relating to table RCPTDATA. One problem solved...13 new ones created. Could this be due to the relationships and the junction table?
Thanks for the help
Wayne
I told you that I deleted the sources for the forms. I said that in the last post. that's why there are errors. I did that to prove to myself that your errors weren't caused by an undetected problem.
Take the code that you see in my example and put it right on into your original file. Make sense?
Your orig file doesn't have those errors. I created them on purpose.
OK, now I think I got it.
That gives some help with what the heck the “#Name?” error is…I wonder about what causes that. Also I still wonder why my original expression didn’t work. With Access there are several ways to do something, is there a reason some work and some don’t? Do we have to try them all to see what works?
Now that the cost associated with one district is captured. The receipt allows multiple district charges for one receipt; my next task would be to create an unbound text box to calculate the total district charges in one receipt. Is that the right direction to go with that?
Thanks for hanging in with me.
Wayne