Hi guys,
An easy problem was solved yesterday using the forums but I now have another that is more serious...
Everything within my database and forms has been working just fine but this morning I launched the application to do some more work and I find that pressing any of my search buttons on my lookup form causes Access to crash. Pressing any search button on the form causes a rotating circle to appear for about 5 seconds then the application crashes.
My query yesterday involved the use of DLookUp. I had the following code in one field of the form:
=DLookUp("[DESC]","[SUBASSY]","[SUBASSY_REF] = ' " & [SUB_ASSY_REF] & " ' ")
This retrieves a value (DESC) from table SUBASSY and places the result equal to that in the SUB_ASSY_REF field already on the form.
The DLookUp code works fine and retrieves and displays the correct values - but only after just saving the form and in that current session. Exiting the session and re-launching it causes the form to crash Access.
If I remove the code, save the form, put it back and re-save the form, the form then works just fine. If I then exit Access and re-open it, the form no longer works and crashes.
How can it work when saved in the same session and then not work when you start a new session? Is there something I need to initialise or set up on launch to stop this from happening?
I can post the database application if necessary but I would have thought that someone would know why this might be happening. Is it something obvious that I'm missing? Please bear with me as I'm a complete newbie with Access although I do have experience with procedural code.
Any thoughts?
An easy problem was solved yesterday using the forums but I now have another that is more serious...
Everything within my database and forms has been working just fine but this morning I launched the application to do some more work and I find that pressing any of my search buttons on my lookup form causes Access to crash. Pressing any search button on the form causes a rotating circle to appear for about 5 seconds then the application crashes.
My query yesterday involved the use of DLookUp. I had the following code in one field of the form:
=DLookUp("[DESC]","[SUBASSY]","[SUBASSY_REF] = ' " & [SUB_ASSY_REF] & " ' ")
This retrieves a value (DESC) from table SUBASSY and places the result equal to that in the SUB_ASSY_REF field already on the form.
The DLookUp code works fine and retrieves and displays the correct values - but only after just saving the form and in that current session. Exiting the session and re-launching it causes the form to crash Access.
If I remove the code, save the form, put it back and re-save the form, the form then works just fine. If I then exit Access and re-open it, the form no longer works and crashes.
How can it work when saved in the same session and then not work when you start a new session? Is there something I need to initialise or set up on launch to stop this from happening?
I can post the database application if necessary but I would have thought that someone would know why this might be happening. Is it something obvious that I'm missing? Please bear with me as I'm a complete newbie with Access although I do have experience with procedural code.
Any thoughts?