If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Attn Graham Seach - Runtime error 2501
Hi Graham;
Thank you for replying to my question regarding "Opening a form based upon two fields". You were right about the fields being strings. I tried your example but now I get a Run-time error 2501 Open form was cancelled... What could be causing this? Thanks |
#2
|
|||
|
|||
Attn Graham Seach - Runtime error 2501
Firstly, next time, rather than starting a new thread, please continue using
the existing one. Try using the Nz() function: DoCmd.OpenForm "frm_Form2", , , "Nz([field1], '') = """ & _ Nz(Forms!Form1!Field1, '') & """ And Nz([field2], '') = """ & _ Nz(Forms!Form1!Field2, '') & """" I don't think nulls are the problem, but I want to rule them out. If this doesn't resolve the issue, you must have some code in the form's Open event that sets Cancel = True. If that's the case, you need to place "On Error Resume Next" just before the DoCmd.OpenForm line. Regards, Graham R Seach Microsoft Access MVP Sydney, Australia Microsoft Access 2003 VBA Programmer's Reference http://www.wiley.com/WileyCDA/WileyT...764559036.html "Lurch" wrote in message . .. Hi Graham; Thank you for replying to my question regarding "Opening a form based upon two fields". You were right about the fields being strings. I tried your example but now I get a Run-time error 2501 Open form was cancelled... What could be causing this? Thanks |
Thread Tools | |
Display Modes | |
|
|