Hello all,
I've got a form with a list box and a button that opens another form. If you double-click on the list box, the form opens to that record. If you click the "add new record" button, I want the form to open blank and change the recordsource to the table where I want the new data to come from. So, I put code into the button to set the list box value to Null when pressed, and I put the following code into the second form:
Private Sub Form_Load()
If IsNull(frmpeople.lstPeople) Then
Me.RecordSource = tblpeople
Forms!frmAddModifyPeople.DataEntry = True
End If
End Sub
But, it doesn't like my IsNull syntax for some reason - it won't recognize the form that I have listed there as an object. All the names are correct - what am I doing wrong?
Thanks,
Chris
I've got a form with a list box and a button that opens another form. If you double-click on the list box, the form opens to that record. If you click the "add new record" button, I want the form to open blank and change the recordsource to the table where I want the new data to come from. So, I put code into the button to set the list box value to Null when pressed, and I put the following code into the second form:
Private Sub Form_Load()
If IsNull(frmpeople.lstPeople) Then
Me.RecordSource = tblpeople
Forms!frmAddModifyPeople.DataEntry = True
End If
End Sub
But, it doesn't like my IsNull syntax for some reason - it won't recognize the form that I have listed there as an object. All the names are correct - what am I doing wrong?
Thanks,
Chris