Hello,
Time to look for help . I have done form with navigation buttons on the top and left, it has the list box and few text boxes (see attached please). What i'm trying to do is to be able to see the data in the list box and able to add, delete, edit data in list box. The records should not be duplicates. Most of functions i managed to make them work, but stuck with one problem.
If i select the record in the list box it will populate information in the text boxes and if i go to other navigation menu and back to same one, it will created duplicate record in to table/list box, which i don't want to happen.
I have tried different events with Dirty function, but no luck so i start wondering if its even possible to make what i want to do or it must be done different way?
for the selected record in the list box im using On Click Event code:
Thanks
Time to look for help . I have done form with navigation buttons on the top and left, it has the list box and few text boxes (see attached please). What i'm trying to do is to be able to see the data in the list box and able to add, delete, edit data in list box. The records should not be duplicates. Most of functions i managed to make them work, but stuck with one problem.
If i select the record in the list box it will populate information in the text boxes and if i go to other navigation menu and back to same one, it will created duplicate record in to table/list box, which i don't want to happen.
I have tried different events with Dirty function, but no luck so i start wondering if its even possible to make what i want to do or it must be done different way?
for the selected record in the list box im using On Click Event code:
Code:
Private Sub lstDepartments_Click()
Dim deptNumber As String
With lstDepartments
txtbDepartName = .Column(1)
txtbDescription = .Column(2)
deptNumber = DLookup("[DID]", "tblDepartment", "[DepartName] = Forms!frm_Admin!frm_SubForm.form!txtbDepartName")
txtbDID = .Column(0)
End With
End Sub
Thanks