Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have 2 forms I'd like to open when the Database opens based on a condition.

Basically If 'table1' exists in the database, then open form1
Else open form2

Is there a way to get this functionality right when the database first opens?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You can use the AutoExec macro and "run form". Create a macro called "AutoExec". Do what is needed in the macro.

There is also a "Display Form" under the "Application Options" that you can use.

share|improve this answer
    
There is no "run form", but there is "open form" but that only lets me open one form unconditionally. –  Shubham Aug 17 '11 at 19:47
    
I tried doing "run code" on a function in a module that opens the right form based on a condition, but when I start my databse, i get the error "The expression you entered has a function name that Access can't find" –  Shubham Aug 17 '11 at 19:49
    
I'm in access 2003 BTW –  Shubham Aug 17 '11 at 19:51
    
Nevermind figured it out! For anyone interested: the function name cant be the same as the module name. –  Shubham Aug 17 '11 at 20:05
    
Thanks for the help! –  Shubham Aug 17 '11 at 20:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.