Ok i changed my code and placed the Me.Dirty code in there and i looked into refresh and requery. I changed one line to requerry but not the others as i want refresh on them.
With the Code listed below everything works still Except i dont get the error now i just get nothing I cant even change the data in the fields marked by the yellow and blueboxes in the photos i posted I can still change the data in the mainform just not the subform. I click on the add temmis item after i have clicked outside of the subform once i have data entered in it just like i described i my first post.
I dont know what exactly is happening but i kind of have a slight idea. It seems that if i have data entered in my subform but not saved and then i lose focus on the subform and then try and come back to it, It fails
Code:
'------------------------------------------------------------
' AddTemButton_Click
'
'------------------------------------------------------------
Private Sub AddTemButton_Click()
If IsNull(ItemName) Then
MsgBox "Please enter the name of the temmis item.", vbCritical
Me.ItemName.SetFocus
Exit Sub
ElseIf IsNull(TemmisNum) Then
MsgBox "Please enter the temmis number.", vbCritical
Me.TemmisNum.SetFocus
Exit Sub
ElseIf IsNull(ExpirationDate) Then
MsgBox "Please enter the expiration date for the temmis item", vbCritical
Me.ExpirationDate.SetFocus
Exit Sub
ElseIf IsNull(UpdatedBy) Then
MsgBox "Please enter your name"
Me.UpdatedBy.SetFocus
Exit Sub
ElseIf Me.Dirty Then
Me.Dirty = False
DoCmd.Requery
'docmd.RunCommand acCmdRefresh "temp leaving this here"
Forms![addtoolboardF].Refresh
Forms![addtoolboardF]![TemmisItemsubF].Visible = True
Forms![addtoolboardF]![TemmisItemsubF].Form.Refresh
End If
End Sub