John_G
VIP Windows 7 32bit Access 2010 32bit
Join DateOct 2011LocationOttawa, ON (area)Posts2,249
So I have to open Forms!sfrmTelework1 ?
No, you have to change the references to refer to the proper form, in this case the one the code is in.
All occurances of Forms!sfrmTelework1 should be changed to Forms!frmNewTelework in the code module for frmNewTelework. (Me! will also work)
It looks to me as if that code was ported from somewhere else (the formsfrmTelework1 ?). There is nothing wrong with doing that - it can save a lot of time - but when you do, you have to look through the code to make sure the references (forms, controls, other subs, etc) will still be valid, and to make sure the code logic still applies in the new location.
You will have to explain the logic in adding an N/A to my current selections of current and situational. What is this line saying. it is obviously a conditional, but please explain.
It's not adding "N/A" to anything, it is testing for it. the line If Me!TelWorkType <> "N/A" then says "If the contents of the form control 'TelWorkType' are not equal to 'N/A', then do...whatever is in the If-Endif block"
TelWorkType happens to be a combo box in this case, but it could be a textbox.
The string "N/A" has no particular meaning to Access - the code can check for any string you choose.
It is this bit that has me thinking that the code was ported from somewhere else, where "N/A" could actually be a value that was in a text box or combo box.
This is an early quote (#5) in this thread and I take it, it is no longer supported by you. In a subsequent quote (#7) you said '
So now (Ahem, mea culpa) - forget what I wrote above, and I'll start again.
So now I must change any reference to
In the code, all references to Forms!sfrmTelework1 will fail. Because sfrmTelework1 is a subform, it cannot be referenced as part of the Forms! collection. To refer to a control on the subform, you need: Forms!frmPersonnel!sfrmTeleWork1.form!txtTeleworkType. In that reference, sfrmTeleWork1 is NOT the name of the subform - it is the name of the form control that contains the subform. In your case here, the two names just happen to be the same, so be aware of which one you have to use.
So now I have the following code sets:
Code:
Forms!sfrmPropertyPass1.Requery
Forms!sfrmPropertyPass.Requery
Forms!sfrmPropertyPass1.updateButtons
[/code]
and
Code:
Forms!sfrmTelework1.Requery
Forms!sfrmTelework.Requery
Forms!sfrmTelework1.updateButtons
So how do I change these in light of your latest post in this thread?
Any help appreciated. Thanks in advance.
respectfully,
Lou Reed