nschroeder
nschroeder
- Local time
- Today, 16:38
- Joined
- Jan 8, 2007
- Messages
- 186
I have a form (Files) with a subform (Folders). Users can check folders in and out of a file by clicking a Check In/Out button on the Files form. This opens a CheckInOut form displaying the current folder record, and they click OK to check the folder in or out. I also have an "All" checkbox on CheckInOut so they can check out all folders at once. I only want the checkbox enabled if all the folders in the current file have the same status (all In or all Out). To do this, in the CheckInOut Load event, I want to loop through the folder records and disable the checkbox if any statuses are different from the first. My problem is, I don't know how to move through the records on the Folders form from the CheckInOut form.
When it hits the "Docmd.Gotorecord" line, I get a run-time error:
"The object "Form_Folders" isn't open".
How do I change record selection on the Folders form? Thanks for your help.
Here's my code:
Private Sub Form_Load()
When it hits the "Docmd.Gotorecord" line, I get a run-time error:
"The object "Form_Folders" isn't open".
How do I change record selection on the Folders form? Thanks for your help.
Here's my code:
Private Sub Form_Load()
With Form_Folders
End SubFolderNum.Value = !FolderNum
FolderStatus.Value = !FolderStatus
Cnt = .RecordsetClone.RecordCount
If Cnt > 1 Then ' There is more than 1 folder
End WithFolderStatus.Value = !FolderStatus
Cnt = .RecordsetClone.RecordCount
If Cnt > 1 Then ' There is more than 1 folder
TxtVal = !FolderStatus
DoCmd.GoToRecord acDataForm, "Form_Folders", acFirst
Result = 1
Do Until Result > Cnt
End IfDoCmd.GoToRecord acDataForm, "Form_Folders", acFirst
Result = 1
Do Until Result > Cnt
If !FolderStatus <> TxtVal Then
DoCmd.GoToRecord acDataForm, "Form_Folders", acNext
Result = Result + 1
LoopcbxAll.Enabled = False ' Statuses are not the same
End IfDoCmd.GoToRecord acDataForm, "Form_Folders", acNext
Result = Result + 1