I have a sub form that is on a tab control of a main form. This sub form allows users to enter records of documents that can be related (linked) to the main form record, or another sub form record. To put this into context, the main form has entry of Projects. There are sub forms for team members who will be on the project, project resourcese, and buildings that the project will be taking place in. Within each building, there can be multiple staff (different from the team members).
I have combos worked out on this particular "documents" sub form to allow users to choose a doc type. Based on the doc type they choose, I set the row source of a 2nd combo, to the specific list of items that the document is to be related/linked to. So if the user chooses a doc type that is an ID which relates to project team members, then the 2nd combo refreshes to show a list of team members that exist for the current project. It stores the ID of that project/team member record in the documents table FK field for related item. The same goes for if the doc type chosen is for buildings, or for building/staff.
My issue is that I need to be able to have 2 views of this data, on this subform. 1 for viewing document records that are related to the main record or any of the main record's related sub records (3 sub form relationships and one sub-sub form relationship). The other view will be for adding new records or editing existing ones.
My idea is to have a toggle button on this one sub form. If it is true, then the form will be in a read only mode, continuous forms view, with the form filter set to a union filter to show the related records. The form has an unbound field that has a hyperlink for launching the documents (all tested and works).
If the toggle is false, then the sub-form will allow adding new records or editing existing ones. The default will be a new record, with the record source to the documents table. The form will be in single form view, with a button to search and launch a search form to find any record needing editing, if that is what is needed.
I am working on the code for the different parts of the sub form that I will have to set, based on the behavior of the toggle button. My issue is that there are so many settings, I cannot seem to find a good place to look them up. I have the behavior of the toggle button down, and the form view. I am wondering if anyone can help me compile a list of behaviors that I will need to set in the below code's with me.frmProjectDocuments. Besides for default view, I am thinking of the following:
[ul]
[li]record source for form and for combos[/li]
[li]navigation buttons[/li]
[li]scroll bars[/li]
[li]allow edits/additions/deletions properties[/li]
[li]form filter[/li]
[/ul]
Can anyone think of anything else I am forgettting? Does anyone know a good resource for looking up the syntax for these? I have been doing that, but one at a time and searching all of google, checking out site after site is time consuming.
This is what I have for the start of the code:
Code:
If Me.tgViewDoDocs.Value = True Then
Me.tgViewDoDocs.Caption = "Add/Edit Document Records"
Me.tgViewDoDocs.HoverColor = RGB(204, 102, 0)
Me.tgViewDoDocs.PressedColor = RGB(204, 102, 0)
Me.tgViewDoDocs.BackColor = RGB(204, 102, 0)
Me.tgViewDoDocs.ForeColor = RGB(0, 0, 0)
Me.tgViewDoDocs.HoverForeColor = RGB(255, 255, 255)
Me.tgViewDoDocs.FontBold = True
With Me.frmProjectDocuments
'Set to single form view for adding and editing records
.Form.DefaultView = 0
End With
Else
Me.tgViewDoDocs.Caption = "View Documents Related to Current Project"
Me.tgViewDoDocs.HoverColor = RGB(0, 128, 0)
Me.tgViewDoDocs.PressedColor = RGB(0, 128, 0)
Me.tgViewDoDocs.BackColor = RGB(0, 128, 0)
Me.tgViewDoDocs.ForeColor = RGB(0, 0, 0)
Me.tgViewDoDocs.HoverForeColor = RGB(255, 255, 255)
Me.tgViewDoDocs.FontBold = True
'Set to continuous form for viewing all records tied to current project
With Me.frmProjectDocuments
.Form.DefaultView = 1
End With
End If
I appreciate any help!
misscrf
It is never too late to become what you could have been ~ George Eliot