Howdy,
I have a DB that utilizes buttons and forms to move throughout the database. In many forms, I have 2 fields, a QUOTEID form and a PROJECT NUMBER form. This is so that you can access the same form by entering either the QUOTEID or PROJECT NUMBER. I have written the vba code for it below.
Private Sub ButtonTest_Click()
If QUOTEID = "" Then
DoCmd.OpenForm "JobQuotes", , , [PROJECT NUMUBER] = [Forms]![JobQuotes]![PROJECT NUMBER]
Else
DoCmd.OpenForm "JobQuotes", , , [QUOTEID] = [Forms]![JobQuotes]![QUOTEID]
End If
End Sub
I have read lots of forums on this topic and believe I am getting an instanced copy of the form open somehow, somewhere that is not allowing it to execute. The bold text is what is highlighted in the debug window. I have a workaround with 2 buttons, one to open the JobQuotes form with QUOTEID, and one for the PROJECT NUMBER, but I am unsure why I can't just do it in my VBA code on 1 button.
Any advice/help is appreciated.