Hide cmdbutton when opening frm in add mode

the forms open correctly in add more without the edit button as in pic3, but it will not open when it is clicked from the frmMain which the form containing the code is inserted in as in pic2 of previous post.
Is this what you wanted to know or am I misunderstanding your question?
 

Attachments

  • Pic3.jpg
    Pic3.jpg
    62.2 KB · Views: 62
I thought you were saying you were opening the continuous form when trying to add new... but that was me misunderstanding.

Going to have some coffee and re-read...
 
Try...

Code:
 Private Sub CmdAdd_Click()
   DoCmd.OpenForm "frmAirport", acNormal, , , acFormAdd
   Forms!frmAirport.CmdEdit.Visible = False
End Sub
 
I believe the form opens correctly but it stays behind the frmMain, which I don't understand why as I have other forms that I open and the open on top of frmMain and there are no event for the open frm
 
Hmm, that is odd, usually that is the reason. Is there any other code that would snatch the focus away from the pop-up? Something different from where you are opening it?
 
I have seem to have solved the issue by changing the PopUp to Yes and added the following code
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
stDocName = "frmAirport"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Any implications on doing that? can you also tell me what exactly the modal options is?
 

Users who are viewing this thread

Back
Top Bottom