On Lesson 2o i cant seem to get the add button to add the project No to the list box my code is bellow.
Private Sub cmdAdd_Click() Dim SQL As String Dim CID As Long
On Error GoTo ErrHandler If IsNull(Forms!frmPLCProject1!ProjectID) Then MsgBox "No current customer record open" Exit Sub End If ErrHandler: MsgBox Err.Number & " " & Err.Description Resume Next Exit Sub
'To check if the record set already exist in the list so we dontr have duplicates -------------
'CID = Nz(DLookup("ProjectID", "ProjNoSearchT", "ProjectID=" & Forms!frmPLCProject1!ProjectID), 0) 'If CID <> 0 Then ' MsgBox "Customer already exists in search list" ' Exit Sub 'End If 'MsgBox ProjNoList With Forms!frmPLCProject1 SQL = "INSERT INTO ProjNoSearchT(ID, ProjectID, ProjectNo, Technician,) " & _ "VALUES (" & !ID & "," & !ProjectID & ", #" & !ProjectNo & "#, """ & _ !Technician & """)" End With
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Search Seminar.