I have been trying to figure our why this code wont work for hours so now it is time to ask for some help. I have exhausted every debugging tool I know of and obviously can;t find the problem. A user adds information into a form and clicks a button to add a new record, however the record never gets added to the table.
Code:
Private Sub cmdSearch_Click()
On Error GoTo Err_cmdsearch_Click
Dim strSQL As String
If CEASE_SEARCHING Then
strSQL = "INSERT INTO tblpbtinformation"
strSQL = strSQL & "( Organizer, PrometricID, CASNumber, City, State, Country, SiteCode, TestDate, PMIGTN, DeadlineDate, MaxCan, OpenClosed, SpecialAcc, Confirm, Notes, RosterReconcile, ReconcileDate, ConfirmationDate, Results, SpecialAccNotes )"
strSQL = strSQL & "SELECT [Forms]![fdlgPBTSearch]![IfOrganizer] AS Organizer,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfProID] AS PrometricID,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfCAS] AS CASNumber,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfCity] AS City,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfState] AS State,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfCountry] AS Country,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfSiteCode] AS SiteCode,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfTestDate] AS TestDate,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfPMIGTN] AS PMIGTN,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfDeadline] AS DeadlineDate,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfMaxCan] AS MaxCan,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfOpen] AS OpenClosed,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfSpecialAcc] AS SpecialAcc,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfConfirm] AS Confirm,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfNote] AS Notes,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfReconcile] AS RosterReconcile,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfReconcileDate] AS ReconcileDate,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfConfirmDate] AS ConfirmationDate,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfResults] AS Results,"
strSQL = strSQL & "[Forms]![fdlgPBTSearch]![IfSpecialAccNotes] AS SpecialAccNotes;"
If IsNull(Me!IfProID) Then
FALLS_SHORT = True
Else
FALLS_SHORT = False
End If
If FALLS_SHORT Then
DoCmd.Beep
MsgBox "You must provide at least the Prometric ID", vbExclamation, "System Message"
Exit Sub
End If
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
Comment