p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

access thread: The data was added... but won't be displayed ...


Message #1 by tegrovesjr@r... on Mon, 24 Jun 2002 22:58:54
Need Help,

An error occurs when I update a field on a form.  The UI presents data 
from joins.  The form property "UNIQUE TABLE" is set 
to "KYLAB_SPEC_HEADER". There are four fields that could be edited, all 
are on the forms "UNIQUE TABLE".  The only field I'm updated was 
KYLAB_SPEC_HEADER.LOAD_FLAG.  The form.after_update event is never fired.  
The database is SQL2K.

Thanks.

ERROR MESSAGE:
The data was added to the database but the data won't be displayed in the 
form because it doesn't satisfy criteria in the underlying record source.

Record Source:
SELECT KYLAB_SPEC_HEADER.CUST_NO, KYLAB_SPEC_HEADER.AREA_NO, AREA, 
KYLAB_SPEC_HEADER.REASON_NO, REASON, KYLAB_SPEC_HEADER.VEND_NO, VEND_NAME, 
KYLAB_SPEC_HEADER.SPEC_TYPE_ID, SPEC_TYPE, KYLAB_SPEC_HEADER.ITEM_NO, 
KYLAB_SPEC_HEADER.SPEC_NO, KYLAB_SPEC_HEADER.EFFECTIVE_DATE, 
KYLAB_SPEC_HEADER.NEW_SPEC, KYLAB_SPEC_HEADER.SPEC_FLAG, 
KYLAB_SPEC_HEADER.ACTIVE_FLAG, KYLAB_SPEC_HEADER.REASON_NO_T, 
KYLAB_SPEC_HEADER.LOAD_FLAG 
FROM KYLAB_SPEC_HEADER 
LEFT OUTER JOIN 
KYLAB_SPEC_REASON_T ON KYLAB_SPEC_REASON_T.REASON_NO = 
KYLAB_SPEC_HEADER.REASON_NO 
LEFT OUTER JOIN 
KYLAB_SPEC_AREA ON KYLAB_SPEC_AREA.AREA_NO = KYLAB_SPEC_HEADER.AREA_NO 
LEFT OUTER JOIN 
KYLAB_VENDOR ON KYLAB_VENDOR.VEND_NO = KYLAB_SPEC_HEADER.VEND_NO 
LEFT OUTER JOIN 
KYLAB_SPEC_TYPE ON KYLAB_SPEC_TYPE.SPEC_TYPE_ID = 
KYLAB_SPEC_HEADER.SPEC_TYPE_ID 
WHERE KYLAB_SPEC_HEADER.item_no = '2011000088' ORDER BY 
KYLAB_SPEC_HEADER.SPEC_NO

MODULE CODE:
Option Compare Database
Option Explicit

Private Sub Form_AfterUpdate()
    gErrorText = ""
    If MyCOAData.spSend2CoaSpecHeader(gErrorText, "U", gSite_No, 
Me.SPEC_NO, Me.ITEM_NO, Me.AREA, Me.EFFECTIVE_DATE, "", Me.LOAD_FLAG) = 
True Then
        MsgBox gErrorText, vbCritical, gTitle
    End If
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'Move cursor like excel
    Call KeyDown(KeyCode, Shift)
End Sub

Private Sub Form_Load()
'Set colors, data format, dropdown controls, recordsource
    Call MyScreen.setChildForm(Me)
    Call MyScreen.FormatDate(Me.EFFECTIVE_DATE)
    Call MyKyLabData.SetDDSpecType(Me.SPEC_TYPE_ID, Me, 1, False)
    Call MyKyLabData.SetDDSpecActiveFlag(Me.ACTIVE_FLAG, Me, 1, False)
    Call MyKyLabData.SetDDSpecLoadFlag(Me.LOAD_FLAG, Me, 1, False)
    Me.RecordSource = gSql
End Sub

  Return to Index