Hello All,
I am using Access 97 SR-2 running in Windows XP
I am getting this error “there isn’t enough memory to update the display. Close unneeded programs and try again” after closing a pop-up form box on a main form.
I have two forms Change form which is the main form and Add_ABC form as the pop-up form. Below is the illustration of this:
Change
Change_ID PK
ChangeCategory
ChangeNo
ABC (Y/N Field)
Add_ABC
ABC_ID
Change_ID FK
Quantity
DateReleased
The main form (Change) opens a pop-up form (Add_ABC) when Y is selected. What I want to happen when the pop up form is opened is to have the PK on the main form match the FK on the pop-up form. Also, I want the main form to stay on the current record after I do data entry and close the pop-up form.. I also want the ID of the newly entered record on the main form to show on the pop-up form so I added an Me.Requery
I placed a code on the after update of ABC field to get the desired result. Below is the code:
Private Sub ABC_txt_AfterUpdate()
Dim i As Integer
i = Me.Change_ID
Me.Requery
With Me.RecordsetClone
.FindFirst "Change_ID=" & i
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
If Me.ABC_txt = "Y" Then
DoCmd.OpenForm "Add_ABC", , , "Change_ID=" & i, , acDialog
End If
End Sub
I got these codes from different posts as I don’t have enough knowledge of VBA. The codes are working fine but the problem is I always get the out of memory error after I close the pop-up form.
I think the problem lies on the code, because whenever I remove the me.requery, the memory error is not showing up but of course the desired result is not happening either.
Maybe the code is too complicated. Is there a way to achieve the same result I want with fewer codes and without the memory error?
Thanks All
I am using Access 97 SR-2 running in Windows XP
I am getting this error “there isn’t enough memory to update the display. Close unneeded programs and try again” after closing a pop-up form box on a main form.
I have two forms Change form which is the main form and Add_ABC form as the pop-up form. Below is the illustration of this:
Change
Change_ID PK
ChangeCategory
ChangeNo
ABC (Y/N Field)
Add_ABC
ABC_ID
Change_ID FK
Quantity
DateReleased
The main form (Change) opens a pop-up form (Add_ABC) when Y is selected. What I want to happen when the pop up form is opened is to have the PK on the main form match the FK on the pop-up form. Also, I want the main form to stay on the current record after I do data entry and close the pop-up form.. I also want the ID of the newly entered record on the main form to show on the pop-up form so I added an Me.Requery
I placed a code on the after update of ABC field to get the desired result. Below is the code:
Private Sub ABC_txt_AfterUpdate()
Dim i As Integer
i = Me.Change_ID
Me.Requery
With Me.RecordsetClone
.FindFirst "Change_ID=" & i
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
If Me.ABC_txt = "Y" Then
DoCmd.OpenForm "Add_ABC", , , "Change_ID=" & i, , acDialog
End If
End Sub
I got these codes from different posts as I don’t have enough knowledge of VBA. The codes are working fine but the problem is I always get the out of memory error after I close the pop-up form.
I think the problem lies on the code, because whenever I remove the me.requery, the memory error is not showing up but of course the desired result is not happening either.
Maybe the code is too complicated. Is there a way to achieve the same result I want with fewer codes and without the memory error?
Thanks All