1) Please read the following document's
trouble shooting steps these will help you solve most of the common errors
http://bytes.com/forums/feedback/913...g-vba-sql-code
>> You will also find that placing
STOP
command in your code (say at line 13) and using the [F8] key to step thru your code will also help find the errors in code that does compile per the above link's T.S. steps.
>> You must perform these basic T.S. steps yourself on your computer. We cannot duplicate your setup.
2) Please use the
[CODE/] tool to format your posted script.
I've done this for
this time AND I have removed the extra spacing. I don't know if this was due to how you cut-n-pasted; however, it does make the code hard to follow.
Amongst other things, the code formatting provides us line numbers... leading to...
3) Line 18: consider using a
For...Each
construct against the fields in current record.
+ You can then test directly against the field name propery.
+ You can then use the current field's value directly to set the value in the other table if the field is the one you desire.
Line 25:
recOut.Fields("ops") = .Fields(i)
Are you sure you have a field that will match the index value of "I"? Once again the
STOP
command I suggested before will help you to determine if that is the issue.
Line 37 , You did not open it, you do not close it
4) "items not found in this collection" most likely a typo in the field name.
Also I would refer to the field as:
recOut![F No]
Just a little easier to type
5) If you can explain what/why you are doing this, there may be an easier method such as an update/append action query.
6) Using the term urgent: Please reserve that word for situations where you may lose your life or your job.
Keep in mind, this is a volunteer site and there is no guarantee (especially during the holidays) that your post will be replied to within any given timeframe.