I have a navigation form with (3) subforms within (1) tab. The customer table in this particular instance is the parent to the customer contacts table. Customer form is a single form, contacts form is a continuous form. Customer table has the PK CompanyID, customer contacts table has the PK ContactID and the FK CustomerID.
In the footer of the customer contact form there is a button to enter a new contact and selecting it opens a separate form to input a new customer contact. When doing this I get the error "Runtime error 2498 Expression entered is the wrong data type for one of the arguments".
Below is the Click event to add a contact and the On Load event of the form it is supposed to load:
In the footer of the customer contact form there is a button to enter a new contact and selecting it opens a separate form to input a new customer contact. When doing this I get the error "Runtime error 2498 Expression entered is the wrong data type for one of the arguments".
Below is the Click event to add a contact and the On Load event of the form it is supposed to load:
Code:
Private Sub btnAddContact_Click() DoCmd.OpenForm "frmAddCompanyContact", , , , acFormAdd, , Me!CompanyID End Sub
Code:
Private Sub Form_Load() If Not IsNull(Me.OpenArgs) And Me.NewRecord Then Me!CompanyID = Me.OpenArgs End If End Sub
Comment