0

Can anyone else replicate this solution from here?

I get an error saying the code does not validate.

enter image description here

enter image description here

Community
  • 1
  • 1
  • Have you seen [this question](http://stackoverflow.com/q/20661510/2144390)? I was opening the table in Design View and then trying to modify the macro and it wouldn't work that way. However, once I started opening the table in Datasheet View and then modifying the macro it worked fine. – Gord Thompson Mar 08 '16 at 17:33
  • Hi Gord, many thanks for the reply. I think I finally got the code to validate but the field within the table remains blank when I add a new record. Please refer to below screen captures I am about to attach. Thanks again for your time. – Paul McQuade Mar 14 '16 at 12:34
  • Sorry, I don't see any option to upload screen captures. I'm wondering if the blank field problem is to do with how the field data type is declared, should this be Number or Text? – Paul McQuade Mar 14 '16 at 12:39
  • The field should be `Text(12)`. – Gord Thompson Mar 14 '16 at 12:46
  • I set the field to Text with 12 characters but still get a blank field when adding records. Also tried resetting the table with the Repair Tool but still the same result. I have added some links to screen captures above in my original post. – Paul McQuade Mar 14 '16 at 13:11
  • 1
    Your final `SetField` action is inside the `Look up a record in` block. Move it down to have it outside that block (but still within the `If [IsInsert]` block). – Gord Thompson Mar 14 '16 at 13:21
  • 1
    Your a genius. Thanks very much. – Paul McQuade Mar 14 '16 at 13:33

0 Answers0