I have two separate forms (not subforms or anything. just two normal forms), one of which is linked to my data table, and the other one is a sort of welcome screen which allows the user to find records and create new records. Unfortunately, the creating of records isn't working as well as I'd like.
The way I have it set up right now is the user types either the name they want to search for or the name they want to add, and clicks the appropriate button.
Here's the welcome screen code:
and the data form code:Code:Sub cmdNew_Click() txtName.SetFocus newEmployee = txtName.Text DoCmd.OpenForm "Page1" DoCmd.GoToRecord acDataForm, "Page1, acNewRec" populateNewRecord newEmployee End Sub
As you can see, in an effort to automatically populate the name, I'm saving the contents of the text box, and sending it off to a function in the data form. Unfortunately, it's telling me that it's not defined, and I have no idea how to fix it. :/Code:Public Sub populateNewRecord(newEmployee As String) txtEmployeeName.Text = newEmployee End Sub


Reply With Quote
(I hope).
)
