Opening a form in add mode using a button + General Form Help

Copper Contributor

Hi All, just seeking some advice about how I can open a form in add mode, from a button within another form. I know you can open the form (In edit mode) using a button, but using a switchboard, you can open a form in add mode. I was wondering if that was possible, using a button in a form. Can I use a button in one form, to open another form in add mode. The reason I am asking about this is: I have a relational database, which I have made previous posts about. I am creating the forms, and I am a little bit stuck. I have a form, "Album", in which a user can enter data about the album. There is a field where the form asks for the Band which made the album. I am using Band_ID for this (A foreign key in my Album table). However, if the band does not appear in the list, I want the user to be able to enter their own band, plus information about the band, using another form, either as a subform, or using a button to link to the Band form. 
Sorry if my explanation is confusing, but I am a new user and am a bit confused.|
Edit: I have seen some code on the web about this, but I don't know where I am to enter it. (DoCmd.OpenForm "YourFormName",,,,acFormAdd) or (DoCmd.OpenForm FormName:="PfrmCustomerDetails", DataMode:=acFormAdd, WindowMode:=acDialog)


1 Reply

@Jqws13_ 

please test