Hi everyone,
I have a problem in access, I have main form which name BillDataMov and subform which name itemMov it is containg relationship between them, i want when the stock "which is in subform" = 0 then a the main form is closed and msgbox appear "that the stock is 0" and delete all the records which is in the main form and the sub form,i put the code in AfterUpdate Event (after i write item number which is in subform) i write this code but when i run it it's appear (compile Error, Method or data member not found).
please help me.
Private Sub item_no_IM_AfterUpdate()
If Me.STOCK = 0 Then
DoCmd.Close acForm, "BillDataMov_F", acSaveNo
MsgBox "The stock is 0"
Dim strSQL As String
strSQL = "DELETE * FROM [BillDataMov]" _
& "WHERE [Bill_no_BDM] = " & Me.Bill_no_BDM
CurrentDb.Execute strSQL, dbFailOnError
strSQL = "DELETE * FROM [itemMov]" & _
"WHERE [Bill_no_IM] = " & Me.Bill_no_IM
CurrentDb.Execute strSQL, dbFailOnError
End If
the problem is when i write (me.mainformtxtboxName) when i put (.) after (me) and searching for the txtbox which is in the main form its not appear at all only the txtbox that on subform is appear, why the txtbox which is in mainform no appear.
please help me
thank you
I have a problem in access, I have main form which name BillDataMov and subform which name itemMov it is containg relationship between them, i want when the stock "which is in subform" = 0 then a the main form is closed and msgbox appear "that the stock is 0" and delete all the records which is in the main form and the sub form,i put the code in AfterUpdate Event (after i write item number which is in subform) i write this code but when i run it it's appear (compile Error, Method or data member not found).
please help me.
Private Sub item_no_IM_AfterUpdate()
If Me.STOCK = 0 Then
DoCmd.Close acForm, "BillDataMov_F", acSaveNo
MsgBox "The stock is 0"
Dim strSQL As String
strSQL = "DELETE * FROM [BillDataMov]" _
& "WHERE [Bill_no_BDM] = " & Me.Bill_no_BDM
CurrentDb.Execute strSQL, dbFailOnError
strSQL = "DELETE * FROM [itemMov]" & _
"WHERE [Bill_no_IM] = " & Me.Bill_no_IM
CurrentDb.Execute strSQL, dbFailOnError
End If
the problem is when i write (me.mainformtxtboxName) when i put (.) after (me) and searching for the txtbox which is in the main form its not appear at all only the txtbox that on subform is appear, why the txtbox which is in mainform no appear.
please help me
thank you