On Mon, 17 Jul 2006 18:51:20 +1000, "Wayne & Kerri Anne" wrote:
¤ Hi All
¤
¤ I have a Access97 Database and if I delete all the records compat the
¤ database when I use AddNew I get an error message Runtime Error '3426': This
¤ action was cancelled by an associated object. and highlights the
¤ Data1.recodset.AddNew line in the command button event.
¤
¤ Code:
¤
¤ Private Sub cmdNewWorkOrder_Click()
¤
¤ Data1.Recordset.AddNew
¤ Call ResetOptions
¤ Call cmd_Click
¤ Loadini
¤ Combo1.Text = KeyValue
¤
¤ End Sub
¤
¤ Private Sub Form_Load()
¤ 'SETUP FOR SCREEN CHANGE RESOLUTION
¤ Dim IniSectionName, IniFileName As String
¤ Dim ResXkey, ResXVal, ResYkey, ResYVal, ResColorKey, ResColorVal As String
¤ Dim IniStat As Long
¤ Call GetScreenResolution(xres, yres)
¤ Call GetAvailableColours(rColor)
¤ IniFileName = App.Path & "\Raptis.ini"
¤ IniSectionName = "ScreenRes"
¤ ResXkey = "XRes"
¤ ResYkey = "YRes"
¤ ResColorKey = "Colors"
¤ ResXVal = xres
¤ ResYVal = yres
¤ ResColorVal = rColor
¤
¤ IniStat = WriteINI(IniSectionName, ResXkey, ResXVal, IniFileName)
¤ IniStat = WriteINI(IniSectionName, ResYkey, ResYVal, IniFileName)
¤ IniStat = WriteINI(IniSectionName, ResColorKey, ResColorVal,
¤ IniFileName)
¤
¤
¤ 'Set resolution when loading program Change these numbers to desired
¤ Resolution and colors
¤ 'useage ChangeScreenSettings Xresolution, YResolution, Colors
¤ ChangeScreenSettings 1024, 768, 32
¤ Call sCenterForm(Me)
¤ Data1.DatabaseName = (App.Path & "\raptis.mdb")
¤ Data1.RecordSource = "tblWorkOrders"
¤ Data2.DatabaseName = (App.Path & "\raptis.mdb")
¤ Data2.RecordSource = "qryStaffNames" 'Using the query because it is
¤ sorted
¤ Data3.DatabaseName = (App.Path & "\raptis.mdb")
¤ Data3.RecordSource = "tblStreet"
¤ Data4.DatabaseName = (App.Path & "\raptis.mdb")
¤ Data4.RecordSource = "tblSuburbs"
¤ Data5.DatabaseName = (App.Path & "\raptis.mdb")
¤ Data5.RecordSource = "tblFireAnt"
¤ Data6.DatabaseName = (App.Path & "\raptis.mdb")
¤ Data7.DatabaseName = (App.Path & "\Raptis.mdb")
¤ Data9.DatabaseName = (App.Path & "\Raptis.mdb")
¤ Data9.RecordSource = "tblPriority"
¤
¤ WO = SendMessageLong(Combo2.hWnd, CB_SETDROPPEDWIDTH, 190, 0)
¤ BM = SendMessageLong(Combo3.hWnd, CB_SETDROPPEDWIDTH, 190, 0)
¤ PC = SendMessageLong(Combo4.hWnd, CB_SETDROPPEDWIDTH, 190, 0)
¤ US = SendMessageLong(Combo5.hWnd, CB_SETDROPPEDWIDTH, 190, 0)
¤
¤ 'LOAD DISTRICT INFORMATION IN TO COMBO1.TEXT
¤ KeySection = "District"
¤ KeyKey = "District"
¤ Loadini
¤ Combo1.Text = KeyValue
¤ End Sub
¤
¤
You might want to see if the following applies:
FIX: Error 3315 or 3426 When Updating a Bound DBCombo Box
http://support.microsoft.com/default.aspx?scid=kb;en-us;189678
Paul
~~~~
Microsoft MVP (Visual Basic)