Thanks you
it Work fine,
I try to change m_intDrawntype as String but it give me runtime error 94 Invalid use of Null, so I when back to m_intDrawntype as variant

Thanks you
it Work fine,
I try to change m_intDrawntype as String but it give me runtime error 94 Invalid use of Null, so I when back to m_intDrawntype as variant
Post a copy of your database so that readers can see the bigger picture.
Remove anything private/confidential.
Do a compact and repair , then zip.
This is the Database
Main form is Form1
You are opening the form form2 then running the code you're running so form 2 will ALWAYS open.
You need to perform this check on FORM1 *before* you open any other forms, then based on the retrieved value open the appropriate form.
on your form FORM1 remove the embedded macro from your button and use
instead.Code:If IsNull(DLookup("[Drawing_Type]", "[FileA MAPPS]", "[Signal_ID] = '" & Forms!form1!Text4 & "'")) Then DoCmd.OpenForm "form2" Else DoCmd.OpenForm "form3" End If
Also remove the form opening commands from FORM2 or you will continue to see form3 opened as well.
run time error-3061 too few parameters.
VBA Code Returning Error Run Time Error 3061
Run-Time Error 3061
Run-Time error 3061