bordentech
asked on
Access 2003 - Error 16389 "Reserved Error"
We've recently upgraded some from Win2k w/ Office 2000 to WinXP w/ Office 2003 and this error popped up. I can't seem to figure out how to fix it. I'll try to explain the best I can.
There's a main form that is used to assign a room to people (B_RationActivityMainForm)
Within this form is a subform (SingleQuartersSubForm) that uses another form as it's source object (B_SingleQuartersAssignmen tSubForm)
B_SingleQuartersAssignment SubForm has a view as it's Record Source which looks something like this:
SELECT RankGrade, SurName, SQ_TransAutoNum, TrgActivityAutoNum, SvcNum, CF_Rank, RoomAssignment, RoomStartDate, RoomResEndDate, RoomMethodOfPayment, RoomResCounter, RoomResNotes, BldgNum + ' ' + RoomNum AS RoomAssignText, RecCreateByUserName, RecCreatePC_Name FROM A_BuildingsTbl
Although only SvcNum, CF_Rank, SurName, RoomStartDate, RoomResEndDate, RoomAssignText and RoomResNotes are displayed on the form.
So the user will choose the SvcNum (which auto populates the rank and last name), the start and end dates. Then they press a little button to assign a room. This button opens a new form where the user can choose the room to assign. Once they choose the room they press the enter button which is supposed to update B_SingleQuartersAssignment SubForm with the room assignment. Here are the lines that are run when the user presses enter:
Forms![B_RationActivityMai nForm].[Si ngleQuarte rsSubForm] .Form![Roo mAssignmen t] = Me.ListOfAvailableRooms
Forms!B_RationActivityMain Form!Singl eQuartersS ubForm.For m.Requery
What its supposed to do is assign the room id to RoomAssignment in the view (which is working fine) and then requery SingleQuartersSubForm so that RoomAssignText is displayed with the new info. This is the line that is causing the error.
Here is a screen shot that may help give a better picture.
http://i12.photobucket.com/albums/a217/rshackleford/Error.jpg
There's a main form that is used to assign a room to people (B_RationActivityMainForm)
Within this form is a subform (SingleQuartersSubForm) that uses another form as it's source object (B_SingleQuartersAssignmen
B_SingleQuartersAssignment
SELECT RankGrade, SurName, SQ_TransAutoNum, TrgActivityAutoNum, SvcNum, CF_Rank, RoomAssignment, RoomStartDate, RoomResEndDate, RoomMethodOfPayment, RoomResCounter, RoomResNotes, BldgNum + ' ' + RoomNum AS RoomAssignText, RecCreateByUserName, RecCreatePC_Name FROM A_BuildingsTbl
Although only SvcNum, CF_Rank, SurName, RoomStartDate, RoomResEndDate, RoomAssignText and RoomResNotes are displayed on the form.
So the user will choose the SvcNum (which auto populates the rank and last name), the start and end dates. Then they press a little button to assign a room. This button opens a new form where the user can choose the room to assign. Once they choose the room they press the enter button which is supposed to update B_SingleQuartersAssignment
Forms![B_RationActivityMai
Forms!B_RationActivityMain
What its supposed to do is assign the room id to RoomAssignment in the view (which is working fine) and then requery SingleQuartersSubForm so that RoomAssignText is displayed with the new info. This is the line that is causing the error.
Here is a screen shot that may help give a better picture.
http://i12.photobucket.com/albums/a217/rshackleford/Error.jpg
ps:
see this link as an example of what appears on the public forums:
http://www.access-programmers.co.uk/forums/showthread.php?t=61865
see this link as an example of what appears on the public forums:
http://www.access-programmers.co.uk/forums/showthread.php?t=61865
ASKER
The DoCmd.RunCommand acCmdSaveRecord command is nowhere in the code. I tried adding the Me.Dirty code in a few different places anyways with no luck. I also tried the following just for the hell of it:
Forms![B_RationActivityMai nForm].[Si ngleQuarte rsSubForm] .Form![Roo mAssignmen t] = Me.ListOfAvailableRooms
If Forms![B_RationActivityMai nForm].[Si ngleQuarte rsSubForm] .Form.Dirt y Then
Forms![B_RationActivityMai nForm].[Si ngleQuarte rsSubForm] .Form.Dirt y = False
End If
Forms!B_RationActivityMain Form!Singl eQuartersS ubForm.For m.Requery
The funny thing is that the line:
Forms![B_RationActivityMai nForm].[Si ngleQuarte rsSubForm] .Form.Dirt y = False
kicked the same 16389 error.
Forms![B_RationActivityMai
If Forms![B_RationActivityMai
Forms![B_RationActivityMai
End If
Forms!B_RationActivityMain
The funny thing is that the line:
Forms![B_RationActivityMai
kicked the same 16389 error.
That is odd!
Did you try the following:
1. comment out the requery line then test if you still get the error (knowing that the query output won't be correct....just a test to definitely pinpoint the requery line as the error line)
2. if the requery line is definitely the problem, then verify that [SingleQuartersSubForm] is the name of your subform control (i.e. the subform container). Often the subform control and the source object (the form inside the container) have the same name, but sometimes they don't.
Did you try the following:
1. comment out the requery line then test if you still get the error (knowing that the query output won't be correct....just a test to definitely pinpoint the requery line as the error line)
2. if the requery line is definitely the problem, then verify that [SingleQuartersSubForm] is the name of your subform control (i.e. the subform container). Often the subform control and the source object (the form inside the container) have the same name, but sometimes they don't.
ASKER
ok I commented out the requery line and didn't get an error. It's definetly the problem. Also [SingleQuartersSubForm] is definetly the subform container. You can see in this screen shot.
http://i12.photobucket.com/albums/a217/rshackleford/StupidError.jpg
http://i12.photobucket.com/albums/a217/rshackleford/StupidError.jpg
The Access 2003 compiler is more strict about using the correct operator, so this might be it:
Change the the dot {.} operator before >>> .[SingleQuartersSubForm] in the assignment statemement on the first line below to the bang operator >>> ![SingleQuartersSubForm] . The requery line has the right operator..... maybe the assignment did not take place and the requery blew up. To verify, place a code break immediately after the assignment statement but before the requery, and check if the assignment actually took place.
Forms![B_RationActivityMai nForm]>>>> >>.[Single QuartersSu bForm]<<<< <<<.Form![ RoomAssign ment] = Me.ListOfAvailableRooms
Forms!B_RationActivityMain Form!Singl eQuartersS ubForm.For m.Requery
Change the the dot {.} operator before >>> .[SingleQuartersSubForm] in the assignment statemement on the first line below to the bang operator >>> ![SingleQuartersSubForm] . The requery line has the right operator..... maybe the assignment did not take place and the requery blew up. To verify, place a code break immediately after the assignment statement but before the requery, and check if the assignment actually took place.
Forms![B_RationActivityMai
Forms!B_RationActivityMain
ASKER
I'd originally thought that was the problem, but when I close all the boxes after getting the error, the new data is still inserted into the table. I retried again anyways with the following code and had the same error again.
Forms!B_RationActivityMain Form!Singl eQuartersS ubForm.For m![RoomAss ignment] = Me.ListOfAvailableRooms
Forms!B_RationActivityMain Form!Singl eQuartersS ubForm.For m.Requery
It seems like I can't run the requery command on SingleQuartersSubForm from another form. I wonder if there's a way to initiate an event on SingleQuartersSubForm after the user presses the enter button and do the requery from there?
Thanks for your help so far.
Forms!B_RationActivityMain
Forms!B_RationActivityMain
It seems like I can't run the requery command on SingleQuartersSubForm from another form. I wonder if there's a way to initiate an event on SingleQuartersSubForm after the user presses the enter button and do the requery from there?
Thanks for your help so far.
I just noticed you also need to fix this >>>> Me.ListOfAvailableRooms
try changing it to: Me!ListOfAvailableRooms
try changing it to: Me!ListOfAvailableRooms
ASKER
Same error again. :(
1. Try doing a refresh before doing the requery and see what happens.
2.<<<<<It seems like I can't run the requery command on SingleQuartersSubForm from another form. I wonder if there's a way to initiate an event on SingleQuartersSubForm after the user presses the enter button and do the requery from there?>>>
You can directly call a procedure from another procedure. Leave the parentheses off when you make the call:
Private Sub Form_Current()
YourCombobox_AfterUpdate
End Sub
2.<<<<<It seems like I can't run the requery command on SingleQuartersSubForm from another form. I wonder if there's a way to initiate an event on SingleQuartersSubForm after the user presses the enter button and do the requery from there?>>>
You can directly call a procedure from another procedure. Leave the parentheses off when you make the call:
Private Sub Form_Current()
YourCombobox_AfterUpdate
End Sub
ASKER
ok I tried both
Forms!B_RationActivityMain Form.Form. Refresh
and
Forms!B_RationActivityMain Form!Singl eQuartersS ubForm.For m.Refresh
I received the 16389 on both.
Forms!B_RationActivityMain
and
Forms!B_RationActivityMain
I received the 16389 on both.
See this link: http://www.mvps.org/access/forms/frm0031.htm
according to the link, if you are refering to a control on subform1 from subform1, the syntax should be:
Me!ControlName.Requery
<<<There's a main form that is used to assign a room to people (B_RationActivityMainForm)
Within this form is a subform (SingleQuartersSubForm) that uses another form as it's source object (B_SingleQuartersAssignmen tSubForm)> >>>>
according to the link, if you are refering to a control on subform1 from subform1, the syntax should be:
Me!ControlName.Requery
<<<There's a main form that is used to assign a room to people (B_RationActivityMainForm)
Within this form is a subform (SingleQuartersSubForm) that uses another form as it's source object (B_SingleQuartersAssignmen
p.s.
by Me!controlname.Requery...I mean:
Me!SingleQuartersSubForm.R equery
by Me!controlname.Requery...I
Me!SingleQuartersSubForm.R
ASKER
I have no idea what's causing the problem here. In my error handling I added this code:
Case 16389
Forms!b_rationactivitymain form!Singl eQuartersS ubForm.For m.Requery
Resume Next
It's working fine now from the users perspective. I'm sick of working on this so I'm going to leave it at that for the time being.
Case 16389
Forms!b_rationactivitymain
Resume Next
It's working fine now from the users perspective. I'm sick of working on this so I'm going to leave it at that for the time being.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
DoCmd.RunCommand acCmdSaveRecord
If you are using the above code line before a requery, try substituting the following code in its place and see if it helps. As always, make sure you have your system backed up before making any changes.
If Me.Dirty Then
Me.Dirty = False
End If
Hope this helps.